From patchwork Fri Jul 15 17:58:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: sergey.fedorov@linaro.org X-Patchwork-Id: 9232415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 76EB060865 for ; Fri, 15 Jul 2016 18:12:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 682B02574A for ; Fri, 15 Jul 2016 18:12:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CCA027F96; Fri, 15 Jul 2016 18:12:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E07612574A for ; Fri, 15 Jul 2016 18:12:50 +0000 (UTC) Received: from localhost ([::1]:34196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO7bV-0002w2-IN for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Jul 2016 14:12:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO7OK-0002lo-EJ for qemu-devel@nongnu.org; Fri, 15 Jul 2016 13:59:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bO7OJ-00072m-FS for qemu-devel@nongnu.org; Fri, 15 Jul 2016 13:59:12 -0400 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:35672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO7OJ-00072Z-7I for qemu-devel@nongnu.org; Fri, 15 Jul 2016 13:59:11 -0400 Received: by mail-lf0-x22c.google.com with SMTP id f93so93475701lfi.2 for ; Fri, 15 Jul 2016 10:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JZJFD124wE7Pu86Ymja79ZKO3d7rxrzyBWn0nURyhCk=; b=VqLd8iSt2JvrnNvqjLYOgVi/2aBVSWVvbk99JNXpo4VHKPO0AUVmdcNl+5n/0EAetH 41tuL+gMDxMH6aG6aqeN23mNlzivyWPMeLp8ZEGFUw2Ob0luzzXAO9ASq582Xll6MfJ3 nuuZFp3OgNfqxMxdZ2uS0DD0AfzamHJXTUyHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JZJFD124wE7Pu86Ymja79ZKO3d7rxrzyBWn0nURyhCk=; b=YM7rjYO//bT/53WK7Avhgn/f6dUZ7PQp5T5Wfkj3/51m3QaPoZDaMxs4YwqNc/CF2s swuUHH4RZjMUhbd+S5Ww/UnOi15N7cltqHsc1DVcJlfN5kvE8wj6THqqQjfDO1g8Bljp frZ3X9pVVOfO1nCqNebCVI86GtFLvkZ3ILUswKeC1DfjYEUJW3Sp8qB9Vk3322YngBAH FVwGUbStgJA6EvyylRsIcJPS+s2NreQBdlswDfJG3iPekP0XrrntWApZwKvnPh/fONie Xm2CXC/EoZkwDPMzoDOSQp+EBbn+5FVchk23xheUdhNk9vKb81Vofgq9JNWdkUyVzz/Q 2xNg== X-Gm-Message-State: ALyK8tLXUoeAE7KeLHnd2+SbOhvF1QnAn0Ahc7i68ppHK6K4nO6niS0mSdGbMiFshC0HMwID X-Received: by 10.25.150.141 with SMTP id y135mr10322886lfd.66.1468605550412; Fri, 15 Jul 2016 10:59:10 -0700 (PDT) Received: from sergey-laptop.Dlink (broadband-46-188-120-37.2com.net. [46.188.120.37]) by smtp.gmail.com with ESMTPSA id g193sm2113268lfb.14.2016.07.15.10.59.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Jul 2016 10:59:09 -0700 (PDT) From: Sergey Fedorov To: qemu-devel@nongnu.org Date: Fri, 15 Jul 2016 20:58:48 +0300 Message-Id: <20160715175852.30749-9-sergey.fedorov@linaro.org> X-Mailer: git-send-email 2.9.1 In-Reply-To: <20160715175852.30749-1-sergey.fedorov@linaro.org> References: <20160715175852.30749-1-sergey.fedorov@linaro.org> 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:4010:c07::22c Subject: [Qemu-devel] [PATCH v4 08/12] 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: mttcg@listserver.greensocs.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, Sergey Fedorov , patches@linaro.org, jan.kiszka@siemens.com, Peter Crosthwaite , mark.burton@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, pbonzini@redhat.com, Sergey Fedorov , bobby.prani@gmail.com, rth@twiddle.net, =?UTF-8?q?Alex=20Benn=C3=A9e?= , fred.konrad@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 9db72e8982b1..6156bdcbef42 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; - /* 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) { @@ -1130,6 +1126,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