From patchwork Tue Sep 13 17:15:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 76116 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1487681qgf; Tue, 13 Sep 2016 11:08:09 -0700 (PDT) X-Received: by 10.55.178.69 with SMTP id b66mr2653639qkf.146.1473790089428; Tue, 13 Sep 2016 11:08:09 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id z1si16050833qtd.154.2016.09.13.11.08.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 13 Sep 2016 11:08:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:50727 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjs7s-0008L6-Sx for patch@linaro.org; Tue, 13 Sep 2016 14:08:08 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s6uA2IO3WF0Eweu+RKhfO1dcZ5n42WZerJLMGOxenq0=; b=zos2h5sy0PoaS+f9qfPL//SRjJystwioK1u7Kfto80qi3HtPSjB+arJQttAbrSCHwF SaUFWl7994+NPor47ztTfAp6apc7T8eIhSMn66hEI6f+g0d29TQv4BK+4R3Ay8MWDPwS iNiB1J5JgH52uWGoWSAZGzspPbMDeXOZ1QQf5MUXUpQbnA2l2Ymhczik4shHY1Y+OGyC 3JCpPa9drNIDFac6Zyf2CcLs21qpy509b392ThlvfBogf+ujrq0NwTgP961vcyjfvF1d LkrBkkSsmMGgJ1tCMlo/Ct4FKTqsp+LlCUIbc0bN7k4qZZ+2hwhPj3DHBnEFFu9EAMMr YCLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=s6uA2IO3WF0Eweu+RKhfO1dcZ5n42WZerJLMGOxenq0=; b=N4S1ffIukebzpx3jNpBRsoYVFtqwj74eVWGq8nMm9s9HsbAscnTcZOMDoR5kERHs9X BYLnZwBMRCGCwK130pgsZn91Bm6MlOlex0szA+Fh+b4Tc1HK2V6BD5Oi9kXCFS/P2SRV a0D8HGsyuZ5QwISewdgcoytL+5bzyWL6BTcf4NKvaow/CkVnDx1hpXJL8EQehJ9BZ0zN Dbn2OuPglQ8JU3slpwdEZRgVo1N6qp/ef8wNIFbuYSD2oAEgK7l2HrIvWUNEgP4BoekV +2VKZ2FCsh8eqr286OyBQ1AhYvNh2PZEO/Tx6UwX00XIFhuKOdngmlrrf4J597mLqbCG MYfw== X-Gm-Message-State: AE9vXwOu/nQt74aMjPl3TYV0BqfqwQ/BYcEcxxfEY7jSoOBaav871Mmz4lPHNUgLEry/YA== X-Received: by 10.28.199.131 with SMTP id x125mr6073947wmf.70.1473787002688; Tue, 13 Sep 2016 10:16:42 -0700 (PDT) Received: from 640k.lan (94-39-180-254.adsl-ull.clienti.tiscali.it. [94.39.180.254]) by smtp.gmail.com with ESMTPSA id s184sm6331987wmb.11.2016.09.13.10.16.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Sep 2016 10:16:41 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 13 Sep 2016 19:15:39 +0200 Message-Id: <1473786989-54823-9-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.68 Subject: [Qemu-devel] [PULL 08/58] 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Sergey Fedorov Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 1.8.3.1 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