From patchwork Tue Jul 19 08:32:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 72274 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp555651qga; Tue, 19 Jul 2016 01:40:43 -0700 (PDT) X-Received: by 10.55.20.29 with SMTP id e29mr48608920qkh.30.1468917643328; Tue, 19 Jul 2016 01:40:43 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r9si19013353qta.107.2016.07.19.01.40.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Jul 2016 01:40:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:53817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQa2-0007iQ-Ru for patch@linaro.org; Tue, 19 Jul 2016 04:40:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQSA-0003Y1-4E for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:32:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPQS8-0002s4-5f for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:32:32 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQS7-0002rs-Vn for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:32:32 -0400 Received: by mail-wm0-x243.google.com with SMTP id i5so2011835wmg.2 for ; Tue, 19 Jul 2016 01:32:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/JfYoOc6v186N0HHXvKLYGYgcRMED13XjlZVUU7/HQU=; b=Y81cOSgJJcHUe/r1SNuayZCyFk7oXAVoWH7vazuvk3dSWpIBx6i6H2MdRe/cXlKrl4 OBcaqFmMWMXCMioXKeHbd/jthntgAjkwVOUmSYFoyaQ3jDHovOjfXaumqxfRlLGEYy+H pRGHTjPLKNH/riHehd4qMPg3dOoGJ9TMWDjJbhr/uSBEcnLzYftg18zsGk9IpfBKLmeL tsyDFg0UGyJuhiuT+bPgS0ofQmwcDnZJNdo4I0H6Mjc/KU45Nm3Cc6QLUSQAngRqNhra cei3LFykdZ9B4DKUkJjWDrRqzbRj/fJRsoZlTm0aZJdvc9CRDRklQuHr/JhmXMvFnMy0 WSZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/JfYoOc6v186N0HHXvKLYGYgcRMED13XjlZVUU7/HQU=; b=fCXIgJU7PMwe7b9RnPi+vBubMN0DhlJ6omD18NMDsf1vqmWP5jkFldqtxvr7tA9h4b Xorvc9bklhY5pByWCzP7J2CeGe6Hw/MTLK7rOCLv+ysm5wMQjIeeXs/0Wla2mBE4j1CS fiO8puzRFamtHVDo4XJjpwWCjVyUSu1e3CQ6nB1fOctll7+zJxI1TyIFeUD1QDLjeg4m BW/uJYAE0edyZRrUk9sXCsuwWZx+HaI6cWiECaeGTfFexZ7+IvXZdqWj3IcuupSkXKkS M+98L+qxonKv0I1VsNSl793cgp4E9kIvJlDq4vCVuBfaDgRkfuixZu4rK9Om8JUh/jxZ qiog== X-Gm-Message-State: ALyK8tLb5vI0vetbCWqpBw2/TXdsJMbdGBEUbCLCh74ymIEwE3RIzB9bEeAJ0Bink0D5nw== X-Received: by 10.28.87.3 with SMTP id l3mr2412026wmb.71.1468917151395; Tue, 19 Jul 2016 01:32:31 -0700 (PDT) Received: from donizetti.lan (94-39-158-5.adsl-ull.clienti.tiscali.it. [94.39.158.5]) by smtp.gmail.com with ESMTPSA id w129sm20677087wmd.9.2016.07.19.01.32.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2016 01:32:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 19 Jul 2016 10:32:17 +0200 Message-Id: <1468917141-8155-7-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468917141-8155-1-git-send-email-pbonzini@redhat.com> References: <1468917141-8155-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH 06/10] tcg: set up tb->page_addr before insertion X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: serge.fdrv@gmail.com, alex.bennee@linaro.org, sergey.fedorov@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée This ensures that if we find the TB on the slow path that tb->page_addr is correctly set before being tested. Signed-off-by: Alex Bennée Reviewed-by: Sergey Fedorov Signed-off-by: Sergey Fedorov Message-Id: <20160715175852.30749-9-sergey.fedorov@linaro.org> Signed-off-by: Paolo Bonzini --- translate-all.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/translate-all.c b/translate-all.c index eaa1232..1ce05ff 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1128,10 +1128,6 @@ static void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc, { uint32_t h; - /* add in the hash table */ - h = tb_hash_func(phys_pc, tb->pc, tb->flags); - qht_insert(&tcg_ctx.tb_ctx.htable, tb, h); - /* add in the page list */ tb_alloc_page(tb, 0, phys_pc & TARGET_PAGE_MASK); if (phys_page2 != -1) { @@ -1140,6 +1136,10 @@ static void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc, tb->page_addr[1] = -1; } + /* add in the hash table */ + h = tb_hash_func(phys_pc, tb->pc, tb->flags); + qht_insert(&tcg_ctx.tb_ctx.htable, tb, h); + #ifdef DEBUG_TB_CHECK tb_page_check(); #endif