From patchwork Mon May 15 14:32:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 681941 Delivered-To: patch@linaro.org Received: by 2002:adf:fd8f:0:0:0:0:0 with SMTP id d15csp1149550wrr; Mon, 15 May 2023 07:37:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7rvOxHkapbswLl7wHPCeFxHNP3Prz1/HacchCqZVoLjoozUxRS+7e2JtPuOjxccTPdqI/G X-Received: by 2002:a1c:f714:0:b0:3f5:e29:bcde with SMTP id v20-20020a1cf714000000b003f50e29bcdemr1552202wmh.17.1684161454179; Mon, 15 May 2023 07:37:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684161454; cv=none; d=google.com; s=arc-20160816; b=1KGuJ8TS1zkRgq+kAn+s81SdGu7msUaKzyeTSDYc3/E8sGtb/Q6zOf6iyn+P6NZGVH 9a+0qiddiH5plHLcWcJpZ/PgOzC7NivG/2uQ8V+XMScr87ogK1gcHGdMpJPv1tsr89me n9r1Qpp2M49TvYVBbNgz1rHPZD69w0r6JnCrSvhQo1PEblrJUb3ecSW8OrZaaY1k7dxl yp0J3/797jacaudK8LwRrj1S/qNCNUb1We7tLyA30NcPdR9d+BLXL/3aau/nyz7TnGiK V6lvQpnRZWmgZdUhsGReX5UEuNfBdBff3YQuyr1r3HKI6box9CSdDunu6uRWu3jrAbcE EeZA== 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=PEsWAFpnCMYNqvb5yhVEEwYFWaIpTnBv29asu3C8fXA=; b=h5kwH7Z7ugrA0W0IInFKkWLgwf1IQy+NBvuFn4434CSdDW9IykAOt8oS4kChdyVX5u IHgieA9C4h5hUAB4K+3aR3fYULiaQhSlp8JmJc4tKUOYiG7agOiNhO7faU/MOD9Ziip6 fYZKdbn+q1L177HF+HYPYmKuOZPdD8P/at2FQF16H5jh/Xfmv/iFD09E+i05Okpi38P3 soHcnn6vBzuNqt42cLjZzBvmMIg9Lo/SWnJXT1w3bvlfB9d1tk4+tHVQkUghdTIU3wQL QuVriFBDgOHkk0rDCcqvdaJFpPZBH6mO/lIyXHaDEiTT93SKqx3HDh+wCux0AJvyX+P5 +WAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=viSPRN0b; 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 j12-20020adff54c000000b003062639dc86si15577088wrp.650.2023.05.15.07.37.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 May 2023 07:37:34 -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=viSPRN0b; 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 1pyZIk-000132-Gu; Mon, 15 May 2023 10:35:50 -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 1pyZHc-00077s-RN for qemu-devel@nongnu.org; Mon, 15 May 2023 10:34:47 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pyZHY-0004zZ-5Q for qemu-devel@nongnu.org; Mon, 15 May 2023 10:34:39 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1aad55244b7so97900595ad.2 for ; Mon, 15 May 2023 07:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684161215; x=1686753215; 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=PEsWAFpnCMYNqvb5yhVEEwYFWaIpTnBv29asu3C8fXA=; b=viSPRN0bskYGKCe2vB2bTfhdcgLJEJpOZaEnEi5JqLgZuweOECFo2l5Dos3y86egFz PBDVbiFnFyNvJycmieq330p4un91Rmk52Zwl+zTTx3qASF0xwfy8shhNsDpaKFhCSeWm CIS0WiCEQQZuD8xwTFRWpsT569BTFPSgzYYRS0ENkDz7xmSbPewN+G32e5tvfdrADV6w hr5q3qQ/lLpM9IuRQ7GbsD4MOP5Wb1JpbxgBnd8zCCR3BuyFqd7+M0QhoMMAhm/n2psF edJeb/zUCFrW9G18TYBUEMkZFG0kNBDxUvkUVGQ4L0A0bV0F/ddjYA4N9dPiBzrfp29Y VWBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684161215; x=1686753215; 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=PEsWAFpnCMYNqvb5yhVEEwYFWaIpTnBv29asu3C8fXA=; b=RqYWBtJvqq+JmfYgfeGWevg/EJESRqfBFKu56x6bvVI05BO/kWbU0XEzFaCnh/VKJO b6V/HJY0rFdi8uj4Arp0868PAEFyYPCvcyKRtwigGgq8HHGojgsTVYpXrEzOrromk9g5 CUA2P7CaRh5jqRZgB3vMt5nJ31xIOwLLxKOOuT+FeEorNZf0YPB0G7M3Wy2Cuhr6r5uL hvva1zDQuGCD8ObBOeUKP+I2KZg/vUs2kWatx2uvYWWwy21kyEvbujhLi8mpPcvIZ6rW l7wQYFp5VMQUhvWUKfIE0dzAMnRvEheOdAkM/quTrYxD+wBAfZ4RfZFg0UQC6QeaaXkC uAyA== X-Gm-Message-State: AC+VfDyIhJRlmXR5ejjGw3G6/X/oxRDJ39uQ5sLNDDof1T0hxbVwqbAU 4LIh4atf3Wx1u1gLV48e4r7g6wjpqP8eOLIybTc= X-Received: by 2002:a17:903:1205:b0:1ac:6d4c:c26a with SMTP id l5-20020a170903120500b001ac6d4cc26amr35717447plh.14.1684161214925; Mon, 15 May 2023 07:33:34 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:9902:96ac:8d8c:4366]) by smtp.gmail.com with ESMTPSA id ik9-20020a170902ab0900b001ab0aec388bsm13694335plb.135.2023.05.15.07.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 07:33:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, Peter Maydell Subject: [PATCH v5 23/54] tcg/s390x: Use full load/store helpers in user-only mode Date: Mon, 15 May 2023 07:32:42 -0700 Message-Id: <20230515143313.734053-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230515143313.734053-1-richard.henderson@linaro.org> References: <20230515143313.734053-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index 968977be98..de8aed5f77 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -1679,7 +1679,6 @@ static void tcg_out_qemu_st_direct(TCGContext *s, MemOp opc, TCGReg data, } } -#if defined(CONFIG_SOFTMMU) static const TCGLdstHelperParam ldst_helper_param = { .ntmp = 1, .tmp = { TCG_TMP0 } }; @@ -1716,34 +1715,6 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) tgen_gotoi(s, S390_CC_ALWAYS, lb->raddr); return true; } -#else -static bool tcg_out_fail_alignment(TCGContext *s, TCGLabelQemuLdst *l) -{ - if (!patch_reloc(l->label_ptr[0], R_390_PC16DBL, - (intptr_t)tcg_splitwx_to_rx(s->code_ptr), 2)) { - return false; - } - - tcg_out_mov(s, TCG_TYPE_TL, TCG_REG_R3, l->addrlo_reg); - tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_R2, TCG_AREG0); - - /* "Tail call" to the helper, with the return address back inline. */ - tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_R14, (uintptr_t)l->raddr); - tgen_gotoi(s, S390_CC_ALWAYS, (const void *)(l->is_ld ? helper_unaligned_ld - : helper_unaligned_st)); - 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.