From patchwork Tue Apr 25 19:31:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 676822 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp2879172wrs; Tue, 25 Apr 2023 12:39:37 -0700 (PDT) X-Google-Smtp-Source: AKy350ZTQKCmCVSaBNkveE53vuVdjwhJ9TVNcBPMuTt95IJb76fGSYvrzSvusCcuHQevLkJm1hKc X-Received: by 2002:a05:6214:1255:b0:5ef:33af:762 with SMTP id r21-20020a056214125500b005ef33af0762mr30457046qvv.37.1682451576888; Tue, 25 Apr 2023 12:39:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682451576; cv=none; d=google.com; s=arc-20160816; b=yDDocjydDlvOZBlqCF3fRF6VRMRypHI9IwwgZgsluVxntbcq0qkI8dU1XP+OXXxAIq OI147mi2/X/Houh8qUmOx67mXZzU+Otc8fOPsMqxFIArDTlP6++DBPITgk+ZrbaU5Eya XxMYXxwMsjlwm0aOVlm+eZqG6crfB50c0oTAUFurMCvgL+Lw+jL+fOJVh7N2AnhZAYwB k3S3MYBZyYFKcNhRCsDbo8IJMrDTEqN2rNEwkQBNFKAXqUhCTuTGcDyR6TOXioW1IUVp /mmKY7MDzbnM22YPFo9BKaMyVh6Rbuk1fT78qKKrS8wlKT5Ba/47amRskCoQh7ihbVVd w9hA== 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:cc:to :from:dkim-signature; bh=+P0K5bbe2wOaUg/ZSYckKIQ1gR+lhjFre48UvlDpErQ=; b=fBPo/iMixDfU4QCTkhX9V/JUvn80ICtQe8LCqXzejCZWuhS3EEQEn9//MnQ92ajgfM r2YeIUyINse6t4TGsV7Muq+gOokBTlCKnHlKwXCPJwhTvJ7LEilRSxD218+KxpjPrnDH jFLzMA8zeEfLMSpAXT/BJ09y2ZOaZx7pE21UVvhmL3w6h95B0kJwudTdGrPjDCQCF1+S CSKUou36i1pXsWsIxS3cLU7AKgIswNWtj9xEe0i1ND6NZN1dnffxpL1bdMp1W2R9HWdR 01uKneEXU2cvezWRq/d3Zvav0wGBTlJT5IX+jSmZxVRigSA0ZE5txmcNb1BZlKT6tSTQ t2PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FSP6bOgz; 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 h22-20020a05620a401600b0074fb79aed78si2780848qko.73.2023.04.25.12.39.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Apr 2023 12:39:36 -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=FSP6bOgz; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prORY-0005G6-53; Tue, 25 Apr 2023 15:35:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prOQy-0003vD-BY for qemu-devel@nongnu.org; Tue, 25 Apr 2023 15:34:42 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1prOQo-0004lK-Ur for qemu-devel@nongnu.org; Tue, 25 Apr 2023 15:34:40 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2a8db10a5d4so61442711fa.1 for ; Tue, 25 Apr 2023 12:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682451269; x=1685043269; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+P0K5bbe2wOaUg/ZSYckKIQ1gR+lhjFre48UvlDpErQ=; b=FSP6bOgzGR5Q2pKiUF7N7/ERmd96FPv6dCD/xt2coqsO1JgZpuYsOM04rhCDlQR5Zz gt1NU2t7RzCcd8Hb+7YXO+JprNCrR6E5nHPp/TJgUYFHTgTWiUvvmJr5k+G0jHXgRzjI XCse2YoulRFIR6/rFlttampKkt3aWDUUZNQ3AGc/6ruXD6OhBebR9cdsMnt/QOBxBf8g eKVKL4yLKldJiTh3vsTKGkAMmx5bzoHz2DHKpPXqh3zDdkyUKkEg7JyQg8FiQPrjrpJg UM4Aeddef8I5XTirfhw3lly2KJj1IV8OLnRSyIX6BxYfFzPM5Jbal1TXMlWde7qhiBuH Ixzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682451269; x=1685043269; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+P0K5bbe2wOaUg/ZSYckKIQ1gR+lhjFre48UvlDpErQ=; b=OYrLZpcr1tSMt3/TnakKixAclq8GTrZfgtlN7+Amqn75SG9A408bP4y2Nageo3Rfck NCZHx8sXCkk6k4iVGLQGPtJR+LmBtJv1LLDKiSLuTTq1XtbO2LOqER4T3KOj83q0P391 xwe5aDVLu2p6TeKDw7WHEbNMi4Z5Vn82OTiURVqHWzaVsy7rAxGRC+PA9HidJqK0K02/ Q79Wt7duNIVTtXohnduStuZhIqyI/GLmww1y5MuOfyhdIQz2si6h3FkJQoDyFwQR0bKF epQG+s6gnPYSz82aL/hYXyQANpeSPmBW/uV0eo2FDTOCd+Ub29XI8l/rBoxqV4PgWCBt Ndxg== X-Gm-Message-State: AAQBX9cHR2+/24d00/oJD6/erXFbj7ARUkHXO4DedNwun+fUx/NuX+vV fPaqeIy8oTQ9dLIpg4oJpmgAMlBGdBb+Ip1DH2qohg== X-Received: by 2002:a2e:8189:0:b0:2aa:3c81:db92 with SMTP id e9-20020a2e8189000000b002aa3c81db92mr3777802ljg.19.1682451269120; Tue, 25 Apr 2023 12:34:29 -0700 (PDT) Received: from stoup.. ([91.209.212.61]) by smtp.gmail.com with ESMTPSA id z23-20020a2e8857000000b002a8c271de33sm2160484ljj.67.2023.04.25.12.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 12:34:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, git@xen0n.name, jiaxun.yang@flygoat.com, philmd@linaro.org Subject: [PATCH v3 25/57] tcg/riscv: Use full load/store helpers in user-only mode Date: Tue, 25 Apr 2023 20:31:14 +0100 Message-Id: <20230425193146.2106111-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230425193146.2106111-1-richard.henderson@linaro.org> References: <20230425193146.2106111-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=richard.henderson@linaro.org; helo=mail-lj1-x232.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+patch=linaro.org@nongnu.org Instead of using helper_unaligned_{ld,st}, use the full load/store helpers. This will allow the fast path to increase alignment to implement atomicity while not immediately raising an alignment exception. Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target.c.inc | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 1f101cbf35..8522561a28 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -860,7 +860,6 @@ static void tcg_out_mb(TCGContext *s, TCGArg a0) * Load/store and TLB */ -#if defined(CONFIG_SOFTMMU) static void tcg_out_goto(TCGContext *s, const tcg_insn_unit *target) { tcg_out_opc_jump(s, OPC_JAL, TCG_REG_ZERO, 0); @@ -907,34 +906,6 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *l) tcg_out_goto(s, l->raddr); return true; } -#else -static bool tcg_out_fail_alignment(TCGContext *s, TCGLabelQemuLdst *l) -{ - /* resolve label address */ - if (!reloc_sbimm12(l->label_ptr[0], tcg_splitwx_to_rx(s->code_ptr))) { - return false; - } - - tcg_out_mov(s, TCG_TYPE_TL, TCG_REG_A1, l->addrlo_reg); - tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_A0, TCG_AREG0); - - /* tail call, with the return address back inline. */ - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_RA, (uintptr_t)l->raddr); - tcg_out_call_int(s, (const void *)(l->is_ld ? helper_unaligned_ld - : helper_unaligned_st), true); - return true; -} - -static bool tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l) -{ - return tcg_out_fail_alignment(s, l); -} - -static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *l) -{ - return tcg_out_fail_alignment(s, l); -} -#endif /* CONFIG_SOFTMMU */ /* * For softmmu, perform the TLB load and compare.