Received: from eggs.gnu.org ([2001:4830:134:3::10]:33319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjrL9-0007xy-Rr for qemu-devel@nongnu.org; Tue, 13 Sep 2016 13:17:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjrL5-00058I-ND for qemu-devel@nongnu.org; Tue, 13 Sep 2016 13:17:47 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjrL5-00057q-Gy for qemu-devel@nongnu.org; Tue, 13 Sep 2016 13:17:43 -0400 Received: by mail-wm0-f68.google.com with SMTP id g141so8267655wmd.1 for ; Tue, 13 Sep 2016 10:17:43 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 13 Sep 2016 19:15:39 +0200 Message-Id: <1473786989-54823-9-git-send-email-pbonzini@redhat.com> In-Reply-To: <1473786989-54823-1-git-send-email-pbonzini@redhat.com> References: <1473786989-54823-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] [PULL 08/58] 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Sergey Fedorov 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 5a5499f..b6663dc 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1131,10 +1131,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) { @@ -1143,6 +1139,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 -- 1.8.3.1