From patchwork Tue Sep 21 02:25:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 514388 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp2639778jao; Mon, 20 Sep 2021 19:29:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyasfUtN+wZRhBtJRF9zs9Ctm+x2at/5khg9lK33kz7zqQEg23SqI3oYh+y8V4Og3gEp2bc X-Received: by 2002:a25:9d83:: with SMTP id v3mr34421774ybp.97.1632191360314; Mon, 20 Sep 2021 19:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632191360; cv=none; d=google.com; s=arc-20160816; b=y6Q/PWHKyX638XTi3pFWuSk/4a3viZTuqzGHtuo1aCZgodVehMVywsFP/sdRdOThEn 0vH28xicVoES7XXvzFFozf2XKlS2THUy28180JHfCmiL+i6MOwoVRrYrvO/otEpDdrsm mjWBPbtFwPbJamtUkrHymjai755pbTzsB9ESwZB9FWGqmiFr+0mE9pAphRsnpMqKiGDo 9siMX2JLtyHxg+08kKXKLD3yApy53i/RHLIcn9eKZe1+ZvxqUJy1/cEdK8mCO1NhXBa2 3vJOxn6mGRdnIn7IflG6+iIM273jWVRg/Dqyf+VXtEqn1ddeAYW88tGKOy/GPnYrU+RX Okvw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=hlOyEAtfEuXg6jlGIwDkdTLizNAydX6cMaz9s5D70Jg=; b=eznHQNOaOj1KDx5T+MFxnjRPvepRPBC5UAkSqo/oQtkPQIxm1l10I1llzC/GVKTevF nmMeMKCbD2LYupS8YTuk9vS58of/ENSFqumPnOjU6+Wb2/k4GFTLh4D/tX4ltv7h4Gdf UuKPCoQG0bSuYOFFWT66TIwLNKoZV7sG7j05ne9/ZTPiSLPKOa5ESBiEMeLPAqhIwEF8 JR1cB31LFEeBbEt/PwmG02eSPuj+W1zXr4UHMWOiKUpEJ2i3cbfwIRp021oTqaQuBO2l RWrN3SLUQ7UyXktwDZkjVscy5gWAAP70YKv3UsXWFdAxml91cTRzwfWEs/tmA22uKPKP PtGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=J2LK2ACH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id t4si15979053ybq.277.2021.09.20.19.29.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Sep 2021 19:29:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=J2LK2ACH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:40154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSVX5-00033h-Q1 for patch@linaro.org; Mon, 20 Sep 2021 22:29:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSVTf-0005f5-Uu for qemu-devel@nongnu.org; Mon, 20 Sep 2021 22:25:47 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:34687) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSVTd-0006Iy-Qs for qemu-devel@nongnu.org; Mon, 20 Sep 2021 22:25:47 -0400 Received: by mail-pl1-x632.google.com with SMTP id a7so3726985plm.1 for ; Mon, 20 Sep 2021 19:25:44 -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=hlOyEAtfEuXg6jlGIwDkdTLizNAydX6cMaz9s5D70Jg=; b=J2LK2ACHDoyCMOiBxV3llSrFHP+OzcCSJRk7qWLs1XAYm91aGHUuG/BV59uxZiD+DE Ikk6volAGr5ejLgpq1d+4FGgSIUQTgYPNARbOsWCGS9KTFEQlo0MKg83IgUlyv2QK7GX mhbdTYKBwfkTauGWV3FtBguNMVjUG0Yrk6f3hQ4ZLfjfGg81J/ajrdHOWVhxGSmfRFz8 FRU0NkWwxR9QSRucUqzxYgX1evK/t9nuZiUyl8F+2pm6HjxVPhzhL70ioSTvf1ckr7MC 4Ow9yzeKYiwFmZpczr6d/FKEO1uOufvpioALGdIRmtj+ww1IZK5w73eO8lcQT4nSaqeC ucXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hlOyEAtfEuXg6jlGIwDkdTLizNAydX6cMaz9s5D70Jg=; b=NpX8h1nCYSCRWojduELUwz+SzH8Lzo07SgYvtJ4NIB7rcjVRtBoiIhAO1cetmWFDGQ oSHGNySIOs6jaeKgf1EI8v2Ep2G0+x0fyiFts5xt7tzvl9D1QI6g208ZN/eiCPuzmsZ+ ZKQbjWTJSyLyx3lDaf8oVf3RSsqcCpcwA3T2+v+RQ/gSf/mLxJbqqWSLoojxH5L4AckJ qC+THq8r4n0C9ziOsB1kit411KpMDoTY5qWuD2F+i1gIXki281jNxSbYMhraIcAjpj/+ dmRYvmEJIgiZVJ0CVhYibyUFXyO2PtvRN1GMBfzvVcxLQGWgSvPnCkb8J4Di5rVCJ3Df BSHQ== X-Gm-Message-State: AOAM533M/xj0SxeP5jC71BRuqHPs5RMNJ7Vxy5G4TAhl0BGPhRnPryi5 wSfwNphO8tc/ggaR4LKkgt5vsK7nogKb8g== X-Received: by 2002:a17:90a:b78d:: with SMTP id m13mr2421753pjr.17.1632191143269; Mon, 20 Sep 2021 19:25:43 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id n9sm15297621pff.37.2021.09.20.19.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 19:25:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/10] tcg/riscv: Remove add with zero on user-only memory access Date: Mon, 20 Sep 2021 19:25:34 -0700 Message-Id: <20210921022534.365291-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210921022534.365291-1-richard.henderson@linaro.org> References: <20210921022534.365291-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Alistair Francis , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target.c.inc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index c16f96b401..dc8d8f1de2 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -1130,10 +1130,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is_64) tcg_out_ext32u(s, base, addr_regl); addr_regl = base; } - - if (guest_base == 0) { - tcg_out_opc_reg(s, OPC_ADD, base, addr_regl, TCG_REG_ZERO); - } else { + if (guest_base != 0) { tcg_out_opc_reg(s, OPC_ADD, base, TCG_GUEST_BASE_REG, addr_regl); } tcg_out_qemu_ld_direct(s, data_regl, data_regh, base, opc, is_64); @@ -1199,10 +1196,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64) tcg_out_ext32u(s, base, addr_regl); addr_regl = base; } - - if (guest_base == 0) { - tcg_out_opc_reg(s, OPC_ADD, base, addr_regl, TCG_REG_ZERO); - } else { + if (guest_base != 0) { tcg_out_opc_reg(s, OPC_ADD, base, TCG_GUEST_BASE_REG, addr_regl); } tcg_out_qemu_st_direct(s, data_regl, data_regh, base, opc);