From patchwork Wed May 3 07:06:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 678603 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp903528wrs; Wed, 3 May 2023 00:09:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ74cKxcunq3FEttcbVSep+J3/lNYShPkR3lnINKmJg2yBvxV8GGc3panPa84o3nlffu0lqM X-Received: by 2002:a05:622a:1387:b0:3e6:4fab:478f with SMTP id o7-20020a05622a138700b003e64fab478fmr30032845qtk.43.1683097743664; Wed, 03 May 2023 00:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683097743; cv=none; d=google.com; s=arc-20160816; b=C9zZkTWqnpgvyh6XMIEsMA7MUgjdSBwHw8Mca2rtPOoEzuZCAZGBo0zJYVv0shnYBP xNdN3pWv4YUCn5x9vXEBjYIKg/4G111YFm06X5xV8X72vCigasgszy43S0+VnSncZ+CS /oxRYqXYRm2ib0KWYGH/KPwvD9YsXIstDlwV/Xv11QmDk0TiKugKAmB2D8iGbIRjJMdJ SpvdjP3myA4hsqhpfY6AT3KFfKhaL0mq47E+cIlpl7oUV6yjl8VUMOcNiPw0s1qnvUoi YM+gY0hjOeiO0+H3o8Bzk54sFBEiTJdk9dmwogKE0LMR+SQo3TpsdZvIG5AsRSQaHw0m DRMA== 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=Xpq7kVqaR8GJII9yFdioUA+mHFs0Vvahpm47qCN+m6U=; b=S3u2TtQmBiwNGkVqCWPeULlxCFyh4qqvTRiQwTB9QVVXK9TYZgkAA6e1Z0KJWKFtEH f2wP3fvpbsnhdqBbvZgrgdrYTX2oLKh1hz0O9X5seoE/jdi8l2rxYUluF26MJl5nDbnB O+5U/VrfLI8rEL9Y2JR/5kqL8j6qs3cuVDTKMzPFa4FkObpO9Xptg7sZmNcEbvzIcP43 a0KDIfdghZ4pkza5OaqMwwPKj+SdP6xmn7wpxZB28sbd+q1Xow8eS8RT/CT58BKrbOkR bfmPcTaGhpqbgw5AkpTpBu3xyLqWuoJrJVYvKn9phf3Vs8mUSeLYBpS5oDmUPvl5I/oy Q4zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=knoefAvh; 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 e29-20020a05620a015d00b0074def505916si17537661qkn.180.2023.05.03.00.09.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 00:09:03 -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=knoefAvh; 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 1pu6bH-0001na-OX; Wed, 03 May 2023 03:08:32 -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 1pu6ad-0007l3-69 for qemu-devel@nongnu.org; Wed, 03 May 2023 03:07:51 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu6a6-0005ac-RY for qemu-devel@nongnu.org; Wed, 03 May 2023 03:07:50 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f1e2555b5aso31680195e9.0 for ; Wed, 03 May 2023 00:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683097638; x=1685689638; 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=Xpq7kVqaR8GJII9yFdioUA+mHFs0Vvahpm47qCN+m6U=; b=knoefAvhROr7EPY6f4Hwq1RDQEx+Ix9wY74EEMUmm3japJhdr90P728D+Z87AWxpNj m1Mt2pXXQpcNDu1qUDgr+ID3B6y3uWh3n62QxArws5ZIokThji5AsYFt1YoAt9MZ6WdK eR0qqUPBB6iVFf31SdC3IRhP10Juy2G1qowRYMis1TsW1jX1eEtwM0JsAEVEaoea2Rmf nnQtYM/z3jLGbCIBMPfGoQZJp7xrw16Je1b+UyHv7YhYWuojJPzOKCKvR+WrpjTpWlQg HLDaumaGXY2y1Ij1g2PZ2A77/uh4CzLqjNWL8YgQ2CAFCGniwTKwya9L3VZIs/z9QTRI XMOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683097638; x=1685689638; 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=Xpq7kVqaR8GJII9yFdioUA+mHFs0Vvahpm47qCN+m6U=; b=f8S7avnQtsUeUhWhN9aaoqY3ZvvdQII6pXa1AT4/fxhh4qxzDY2DlF3kExUwKsRMtz XCmoqhSJ0YFz7+eE5BwMu8KyHcPnW0UJfVlaGrq+SNeXtY4o3MVbaz6RiB7GuHiMBDIl YMQ3jLsfrVvu4pqcWyp8ej9XZxtyBcaBdm5fS/85RMgVHQU5fq9EVOqqa6Z4sIRJe13O sEKA09lZZk9Jju6fvnZ4OV7fCNO+weEOd2B5B5b75OZSKS2+sNyoeJXSEDvVYBlsq/27 9gP5oB00FaeVOg6s4eWv7w8vGaHoEFfFUciKJ6G80hSnespzP78lUwsivztfeN8FM/JX oZ2w== X-Gm-Message-State: AC+VfDxtUR9YnEklH81XzwMkv/Gi8yT5ccQ/ugnLivXU0zzQolv9v2JG wv0HYphYv8FCOnSvNQcTbYpjcqSz93Ej8e+LGE9adw== X-Received: by 2002:a7b:c408:0:b0:3f1:75b6:8c7 with SMTP id k8-20020a7bc408000000b003f175b608c7mr13318615wmi.37.1683097637959; Wed, 03 May 2023 00:07:17 -0700 (PDT) Received: from stoup.Home ([2a02:c7c:74db:8d00:c01d:9d74:b630:9087]) by smtp.gmail.com with ESMTPSA id q3-20020a1cf303000000b003f3157988f8sm921184wmq.26.2023.05.03.00.07.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:07:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: git@xen0n.name, gaosong@loongson.cn, philmd@linaro.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org Subject: [PATCH v4 27/57] tcg/arm: Use full load/store helpers in user-only mode Date: Wed, 3 May 2023 08:06:26 +0100 Message-Id: <20230503070656.1746170-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230503070656.1746170-1-richard.henderson@linaro.org> References: <20230503070656.1746170-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x333.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 Reviewed-by: Peter Maydell --- tcg/arm/tcg-target.c.inc | 45 ---------------------------------------- 1 file changed, 45 deletions(-) diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index a02804dd69..eb0542f32e 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1325,7 +1325,6 @@ typedef struct { bool index_scratch; } HostAddress; -#ifdef CONFIG_SOFTMMU static TCGReg ldst_ra_gen(TCGContext *s, const TCGLabelQemuLdst *l, int arg) { /* We arrive at the slow path via "BLNE", so R14 contains l->raddr. */ @@ -1368,50 +1367,6 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) tcg_out_goto(s, COND_AL, qemu_st_helpers[opc & MO_SIZE]); return true; } -#else -static bool tcg_out_fail_alignment(TCGContext *s, TCGLabelQemuLdst *l) -{ - if (!reloc_pc24(l->label_ptr[0], tcg_splitwx_to_rx(s->code_ptr))) { - return false; - } - - if (TARGET_LONG_BITS == 64) { - /* 64-bit target address is aligned into R2:R3. */ - TCGMovExtend ext[2] = { - { .dst = TCG_REG_R2, .dst_type = TCG_TYPE_I32, - .src = l->addrlo_reg, - .src_type = TCG_TYPE_I32, .src_ext = MO_UL }, - { .dst = TCG_REG_R3, .dst_type = TCG_TYPE_I32, - .src = l->addrhi_reg, - .src_type = TCG_TYPE_I32, .src_ext = MO_UL }, - }; - tcg_out_movext2(s, &ext[0], &ext[1], TCG_REG_TMP); - } else { - tcg_out_mov(s, TCG_TYPE_I32, TCG_REG_R1, l->addrlo_reg); - } - tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_R0, TCG_AREG0); - - /* - * Tail call to the helper, with the return address back inline, - * just for the clarity of the debugging traceback -- the helper - * cannot return. We have used BLNE to arrive here, so LR is - * already set. - */ - tcg_out_goto(s, COND_AL, (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 /* SOFTMMU */ static TCGLabelQemuLdst *prepare_host_addr(TCGContext *s, HostAddress *h, TCGReg addrlo, TCGReg addrhi,