From mboxrd@z Thu Jan 1 00:00:00 1970 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) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 19 Jul 2016 10:32:17 +0200 Message-Id: <1468917141-8155-7-git-send-email-pbonzini@redhat.com> 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 06/10] tcg: set up tb->page_addr before insertion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: serge.fdrv@gmail.com, sergey.fedorov@linaro.org, alex.bennee@linaro.org 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(-) 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 -- 2.7.4