Received: from eggs.gnu.org ([2001:4830:134:3::10]:43038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bN44c-0001nR-8T for qemu-devel@nongnu.org; Tue, 12 Jul 2016 16:14:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bN44Z-0008GE-Sm for qemu-devel@nongnu.org; Tue, 12 Jul 2016 16:14:29 -0400 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:33905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bN44Z-0008G9-Kx for qemu-devel@nongnu.org; Tue, 12 Jul 2016 16:14:27 -0400 Received: by mail-lf0-x22a.google.com with SMTP id h129so22907579lfh.1 for ; Tue, 12 Jul 2016 13:14:27 -0700 (PDT) From: Sergey Fedorov Date: Tue, 12 Jul 2016 23:13:43 +0300 Message-Id: <1468354426-837-9-git-send-email-sergey.fedorov@linaro.org> In-Reply-To: <1468354426-837-1-git-send-email-sergey.fedorov@linaro.org> References: <1468354426-837-1-git-send-email-sergey.fedorov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v3 08/11] 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, mttcg@listserver.greensocs.com, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, serge.fdrv@gmail.com, cota@braap.org, bobby.prani@gmail.com, rth@twiddle.net Cc: patches@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , mark.burton@greensocs.com, pbonzini@redhat.com, jan.kiszka@siemens.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, Sergey Fedorov , Peter Crosthwaite 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 --- translate-all.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translate-all.c b/translate-all.c index ee8308209350..b7369fe5bd04 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1119,10 +1119,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) { @@ -1131,6 +1127,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.9.1