From patchwork Wed May 9 17:54:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135344 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp66802lji; Wed, 9 May 2018 11:14:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqDkl0MDbr/ucueqeYclmnAJ1UPsGzicbyT6YaPCbpXsJF9vazdrTsAwsKAoqg7PgHg+hA8 X-Received: by 2002:aed:24d1:: with SMTP id u17-v6mr44129130qtc.116.1525889675577; Wed, 09 May 2018 11:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525889675; cv=none; d=google.com; s=arc-20160816; b=OFC91/EKgxni+0i2Y27RpQ39Z42bv7k3Hlo61Hy9WoJh2mJEphSFdPGB751j7H97bk tk0DRIIBvrB5bQw8ejyfuMbvHpN+U+VO4g/TXGnAwVgPDH5/o4bFID1tCUUlXmLzuuR1 xyEZD/T7oVcEm3E4ZdpQz2vgDM7NPJ/zFzHX9R7/mZ/1O7ppkguMknxTggfpu30m+Iul 5mf9IqNowjgsJB11Dhwzz1Ev+R+qlkwpV99KO9eR75QKXbHr0pOnPJK5Fyxs4G3YocW/ B9QFBipGQgqUPIuct5LKl9k943WvH9OwFcUpX1t+Z+fAHEsYni+Tuin7cN1yiDVajwEy iB2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=xOwSIH2j9Catn/Erb0X0rVdV8iOEx2AqnZ6acvM/W4Q=; b=QUG9vZ3ZCCOAReK9lSwBSgaWf5W/B0ZB7FDUw8xKzvNAsG/xxi+7Ge1WO4ThjwTCGJ 8zKQ6vLYDJ8iIaUcjDFOshkIdfLlWMLu9vzTGEgkI7j8DYzvwlLGkvYUNh7yTZS3CqeW 2Eu6OeuX8xanWh6cUETQi93WCTlheb2a01HBSC83rHg2dNQLGUYLXLGZz5ZbeXmQFfcL EtcszdSR/uCy5cloTGSUxRzpko06hfwLbQSxe10wpy1uywAwfRwYsGfIl8v96nZ+7uf4 2dld3qG6BL+VsoizpN5QdU+ucn0P4FchskjEssom4F8jSQzeqJKyscycXFlciACMOFaG eq6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jmsFtRsD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k187si3252214qkd.126.2018.05.09.11.14.35 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 09 May 2018 11:14:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jmsFtRsD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGTbn-0000v2-1p for patch@linaro.org; Wed, 09 May 2018 14:14:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGTJN-0005Cu-5E for qemu-devel@nongnu.org; Wed, 09 May 2018 13:55:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGTJK-0005rD-IH for qemu-devel@nongnu.org; Wed, 09 May 2018 13:55:32 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:36005) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGTJK-0005py-5V for qemu-devel@nongnu.org; Wed, 09 May 2018 13:55:30 -0400 Received: by mail-pf0-x242.google.com with SMTP id w129so20577734pfd.3 for ; Wed, 09 May 2018 10:55:29 -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; bh=xOwSIH2j9Catn/Erb0X0rVdV8iOEx2AqnZ6acvM/W4Q=; b=jmsFtRsDJ4osZMlS7ZZhq95umXdITwm5HTzkCwDLxd/uxfeRPno7QIBholxd3Qy7mT OASFzV8zLArbB/ZIN4B0fzWtUHj347jZlCQexAypZvRHTjWlpXT4WjDM7TpXDV4BCmrL XRiK5+5bkly6knVxDHQiVe/dIIzXjVpGv7Vy4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xOwSIH2j9Catn/Erb0X0rVdV8iOEx2AqnZ6acvM/W4Q=; b=tig8h4xUPzvJ3gPrjtOmk8k9SfVTYM6jZZDuODUjrPDGnbZS8BblDOia5QY5msq1qP Vzi6RiReuVkn+m6XNYKZM3UEmfUrxtOhXRZ6LMFmvIUJy/o9R8UNNM0mHO0J+v/iwB05 2zZ/Lk58fzPf4pK8rNJUvda9Gz8rijIgWTuZedgV+2kOPl7S6nkIN0a2H3DMWYx/WKJB cL8royGV47IeDwEBfwZtEPO5hj81RGQ3njkj7lpCwZgnVmSlmFVemJJ6yx+Ob4+U1teL LeT5tdulnmbXhnYESD7RTXO4oVc2/yeMZRjOVS3UKHYxlju6t3TWX6LbEgWFuTTUgNA9 51iw== X-Gm-Message-State: ALQs6tBGUw1qgXrMJpQRo/RZm4Y1BE1E0U0V6z56WXjKv4Cy8bhAKHR1 SMddqkmpt27lW1mhPuOkgn+HV7bNevQ= X-Received: by 2002:a63:6e84:: with SMTP id j126-v6mr37088654pgc.310.1525888528793; Wed, 09 May 2018 10:55:28 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id l90sm60332813pfb.149.2018.05.09.10.55.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 May 2018 10:55:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 9 May 2018 10:54:46 -0700 Message-Id: <20180509175458.15642-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509175458.15642-1-richard.henderson@linaro.org> References: <20180509175458.15642-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::242 Subject: [Qemu-devel] [PULL 16/28] target/mips: use lookup_and_goto_ptr on BS_STOP 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: peter.maydell@linaro.org, Sagar Karandikar , David Hildenbrand , Palmer Dabbelt , Mark Cave-Ayland , Max Filippov , Michael Clark , "Edgar E. Iglesias" , Guan Xuetao , Yongbok Kim , Alexander Graf , "Emilio G. Cota" , Richard Henderson , Artyom Tarasenko , Eduardo Habkost , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , David Gibson , Peter Crosthwaite , Bastian Koppelmann , Cornelia Huck , Michael Walle , qemu-ppc@nongnu.org, Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" The TB after BS_STOP is not fixed (e.g. helper_mtc0_hwrena changes hflags, which ends up changing the TB flags via cpu_get_tb_cpu_state). This requires a full lookup (i.e. with flags) via lookup_and_goto_ptr instead of gen_goto_tb, since the latter only looks at the PC for in-page goto's. Fix it. Reported-by: Richard Henderson Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-by: Richard Henderson --- target/mips/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.0 diff --git a/target/mips/translate.c b/target/mips/translate.c index d8e717dacf..69137d0b3f 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -20343,7 +20343,8 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb) } else { switch (ctx.bstate) { case BS_STOP: - gen_goto_tb(&ctx, 0, ctx.pc); + gen_save_pc(ctx.pc); + tcg_gen_lookup_and_goto_ptr(); break; case BS_NONE: save_cpu_state(&ctx, 0);