Received: from eggs.gnu.org ([2001:4830:134:3::10]:36350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP4qk-0004b1-PQ for qemu-devel@nongnu.org; Mon, 18 Jul 2016 05:28:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bP4qi-0006cT-Pp for qemu-devel@nongnu.org; Mon, 18 Jul 2016 05:28:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP4qi-0006cK-Jv for qemu-devel@nongnu.org; Mon, 18 Jul 2016 05:28:28 -0400 From: Paolo Bonzini Date: Mon, 18 Jul 2016 11:27:48 +0200 Message-Id: <1468834075-25669-17-git-send-email-pbonzini@redhat.com> In-Reply-To: <1468834075-25669-1-git-send-email-pbonzini@redhat.com> References: <1468834075-25669-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 16/23] 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=C3=A9e 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=C3=A9e 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 9db72e8..6156bdc 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1118,10 +1118,6 @@ static void tb_link_page(TranslationBlock *tb, tb_= page_addr_t phys_pc, { uint32_t h; =20 - /* add in the hash table */ - h =3D 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 !=3D -1) { @@ -1130,6 +1126,10 @@ static void tb_link_page(TranslationBlock *tb, tb_= page_addr_t phys_pc, tb->page_addr[1] =3D -1; } =20 + /* add in the hash table */ + h =3D 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 --=20 2.7.4