From patchwork Wed Aug 18 19:19:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 498981 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp1004787jab; Wed, 18 Aug 2021 13:18:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvIUpNNgJqTVDY9ly8miz+kpTLbjIjXaxgWhdQGO2+gE3GrKKK2VJoyOZJZL9anx3+9Mh9 X-Received: by 2002:a9f:2341:: with SMTP id 59mr8230141uae.4.1629317929200; Wed, 18 Aug 2021 13:18:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629317929; cv=none; d=google.com; s=arc-20160816; b=jljJgF2UVO2teww6SUJPCKycALTfDeBnUWf3oBkkjY3li2SvXp9SJY5Y5JVQbJQ5rv gFuOgtYUBJw9crwRElXZ5H3tAkh34ScC+hVFCSpSuKhCKfbjn0d4oQWoYcwbxrJ/jDac y21uGKJMK+N4AOEAirc8UIsExUz+A+0IGw5UNMkrfsDppKk92QCGGrMiUYh7P6vxAkPm QpQVDLU6Samv+njTV+b7csi0C9ACLkHhojDHhjjWaydvH0GjdiM4k8TjWliVoAUTVy+X w6XureEvfsraqGt6gq5+X3ngybV21FiSN1L8cj3g1nZeAI1D+02my5V3CgCBYc1xIM5T 8ulg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=vNwWy+xC/ycIjV/MFMh5N0tv4BuNkqj0zWC2JbLhrZI=; b=uWv0hzVZNRrUCg82OPnFreQjt9LV6E/Qwrvn5lU6CcZzLLMn/tbC049AsnAKakRy1F EWOrqg1aioL2Ynh2tOwjshaa1AQjtNF9ULoKNsVRq3iUKdpH8HtfF+AYQF9QQgJ+PJIz r4/b6okhmT/Sg0m0B9lWaBiIBgl/ORdzF0ajkEsLkqqtWOosUUI+JAyWwVfpC0y2ry0H yOLsChmTMgueyeIdEfFKS7dsDSmJ52X3REdLmIuULiYjRLbfQ8aEqruHuhfsI1Iyeky6 8jvnQGSzlV81Ury4jMe3/W1eBidUtV2KBflELfAwpIYrm4ergzr5pZ4JF/B8a+lgvYNk qZlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZmiT1K5Q; 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=pass (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 q5si786044uao.179.2021.08.18.13.18.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Aug 2021 13:18:49 -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=pass header.i=@linaro.org header.s=google header.b=ZmiT1K5Q; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGS1Q-0005my-JR for patch@linaro.org; Wed, 18 Aug 2021 16:18:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGRA8-0008Pv-Gd for qemu-devel@nongnu.org; Wed, 18 Aug 2021 15:23:44 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:41946) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGRA6-0002xX-Ux for qemu-devel@nongnu.org; Wed, 18 Aug 2021 15:23:44 -0400 Received: by mail-pg1-x52d.google.com with SMTP id k24so3318662pgh.8 for ; Wed, 18 Aug 2021 12:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=vNwWy+xC/ycIjV/MFMh5N0tv4BuNkqj0zWC2JbLhrZI=; b=ZmiT1K5Qb3IvJOm3MJrNPSOr2cGiPJPVxwEtbtdabVJrWSnVjHXngSRQNwzyCqD7fy 5G52n3U5rYkng1PMHGJpNdopEbM9RPdv0Uajer6wqvF9lNgXqdzL6SDc1ssAGHYd//on uCJTyOuNmrKyKTxmUKRni1a17DLB66hisyfuZ61mSnLAI7uwb4Kn1uEX36mpocJ8ITTQ FvondRnqy5DKpKObkd4cS0mYlo/yTOg27EtTRmoqGsIcH0h0aegUhrxc0RgEGivsbNXf QdfP4Nac3vUNcsR2JMJvVXUBBU8w6YVtXK+NaBEsWGI5j36xmW9WDMjfo+ar4jRNdCF+ Bc9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vNwWy+xC/ycIjV/MFMh5N0tv4BuNkqj0zWC2JbLhrZI=; b=UzM35XVkc3aZrfgyiht0Fza3mJMp0H6VTZB8Pq3AlBK7LVnXzW7ZjPA9bvIwkGPPwS KczF1IeHwQOnsLuNUmLHy1yIdEAAWBGRpCHkoN1RtCJPqyOIEb4ksCPZZwbmJtCgi7O5 cCgdGC4HaPWGJ7NxgmzXLPfjh3gGhgZKgJok2s4ZIgGO8v776fdT2FdGzByzZ6LIqdPN SlXkHLQlNtoBkltxPQ5kKOY0a1D1JkLwLJL1ToNzkpzE3AwuLPPzd0PiPcWewCpkJxG5 p2B6xAnxKgQZkmvyy27/tKRrcUl7yiKzSPKvKse+nP35/NASNudMztbXszDK6ZjRSPky ApgQ== X-Gm-Message-State: AOAM530wFgTxfBoD+5Ty5QY6lAGfQ6nixmeAb7O0kXihSkmoVbPKBt3L ecHYakkUQCOU4ynnLL41muS95lYETT8HIw== X-Received: by 2002:a62:878a:0:b029:3e0:7810:ec36 with SMTP id i132-20020a62878a0000b02903e07810ec36mr10910220pfe.4.1629314621766; Wed, 18 Aug 2021 12:23:41 -0700 (PDT) Received: from localhost.localdomain ([173.197.107.15]) by smtp.gmail.com with ESMTPSA id w82sm569302pff.112.2021.08.18.12.23.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 12:23:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 66/66] tcg/riscv: Remove add with zero on user-only memory access Date: Wed, 18 Aug 2021 09:19:20 -1000 Message-Id: <20210818191920.390759-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210818191920.390759-1-richard.henderson@linaro.org> References: <20210818191920.390759-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target.c.inc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index f75dcf88f8..b84a4e876b 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -1182,9 +1182,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is_64) if (a_bits) { tcg_out_test_alignment(s, true, addr_regl, a_bits); } - 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); @@ -1256,9 +1254,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64) if (a_bits) { tcg_out_test_alignment(s, false, addr_regl, a_bits); } - 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);