From patchwork Wed May 3 07:06:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 678626 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp905174wrs; Wed, 3 May 2023 00:13:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WywXBGudDYQUdgWezmz4QqV0pbTEKI4RqPd92xrqJn8oopXmhT+6Wn2YBw3BjaFWTxALI X-Received: by 2002:a05:6214:4116:b0:56e:a976:7d16 with SMTP id kc22-20020a056214411600b0056ea9767d16mr8746751qvb.51.1683097992728; Wed, 03 May 2023 00:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683097992; cv=none; d=google.com; s=arc-20160816; b=NBjoC4l/ozZewG++IJfjDNqM/Q14bHJIv9bTkP+Jaii4eS0YjcltciMfxNxR4qZlRw 9Ua7KnmmhlE/iUG3N2+VM2Djnh4eacZHEYLfE6KJDYtSZbAmjHDa7n9UCUOT9HUMylZP UQmTzsiQJaUC45fM2Hck1rk2FIvvXnmveD3DG+MxrdNaOm0foApWbob2wNJ8un1FXR5/ X9YmR1TPuBuulpbThiqnDi1Oa/nZ9lsB2Z1dVDTLY8PFaMc5yyomN4soTf6XXQKMWahT bnHzzqsWzn7O/0WWjrsE748vGKhmVQBvFsOuS4d3X7YxxVYG4vslhBy6p7yuu4m59bqP H7yw== 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=RwxIOwfcK07f8Ih0O3BZ3uVtj/nizIzXDkTDJdsGEMk=; b=sSkZgL9hD0o2FIrJQ7h1JX6QqTFx7UkAG/0rEj1LixXwf6jkcrgxuHbh8OCcKcC7UJ tgGMnVRcAFXcHoIzwaHFKD/LKlec7ilhWODQjKQNOnkgSF78KkyFWoGXiIv7hZRQZF7/ NPaAw+nSzXCY0Kc3EXODZ+jHBvhov3DAz5wwJEcIplUJ4MGj3SQn06/oMV9Yb2L1WT11 HQ6pPj3mLP1Ezuvw4pkwCRgf9o+3bj2ULXVQGmHXLRzM62wDTEywNhYktY1BW76ur5gs 9ceWHzo6APGmEFHuWejD0vx7IztxQm3KMMxDXt9oryEdSBLuBSk7oTRcv02lMkOYHlh2 +RrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ar9PbvoX; 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 r16-20020ac85c90000000b003f1f38ea856si7741996qta.317.2023.05.03.00.13.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 00:13:12 -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=Ar9PbvoX; 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 1pu6b9-0000yF-3d; Wed, 03 May 2023 03:08:23 -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 1pu6aW-00070U-1t for qemu-devel@nongnu.org; Wed, 03 May 2023 03:07:44 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu6a4-0005ka-L0 for qemu-devel@nongnu.org; Wed, 03 May 2023 03:07:43 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f19afc4f60so29573105e9.1 for ; Wed, 03 May 2023 00:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683097635; x=1685689635; 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=RwxIOwfcK07f8Ih0O3BZ3uVtj/nizIzXDkTDJdsGEMk=; b=Ar9PbvoXEisP7CprGBEplweyw1ndLyo4wA/3DQ2mgQuwfkD1lZo81FDOV9V6KSKf2/ U+lNP943moxxmCET4sjKRGpFPz9dzbq7AIq1kWYIs4Tyb5/+oFGmL7ISYyUo+ReEogu4 ZVZpUiIfEsF+7YjicK0mLD+egTz1YHpuZnkgHt2oxmTqwwguhZK6lzXPiC8HN50uu5UG b16JUmwmzlApGmhpEpxHNMsgmC+zCkz8/AL4nqee8S+CwFL8mP/mzDDRRFS/dJWeZWJj 2rjB1k1PxqCiXPC4yRhhNbIFCJyAsua2JnyD28/uNfxXEMyzD5kSERz6Ofal8b6yNZMY h5wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683097635; x=1685689635; 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=RwxIOwfcK07f8Ih0O3BZ3uVtj/nizIzXDkTDJdsGEMk=; b=fFxNfjwHECO9hsWGjjs8PzHsKUUwrkeODlnI04i1FV9k9ASPSwYEbv7iUtjaqc7R40 5rpO6gc13fY2hlsn7eiKOh+E2ahyBoOee/hVAzUoUaANwJaTqyppHrJnUzthLulROMQi fDo5QkXf+9r0uuPjGTojE4lP/0Zcv0eMXqSr6VIaHYXwQ4qz7afUcBth7kAlI4LbgyOA lPCLolftcw69X9enA3vVGH7pPEFDZWHJZsEIQP6zAJb1aPLN9R6RG+8i7ARa89CtCz7/ GGKmMtYNoHTUqmEnvx5VjIJTE/yS4aGkxNuVOb+vr2jxCAc94V+OJmRwzaYdNZ+oJH4X B6Aw== X-Gm-Message-State: AC+VfDzH4BGmbVQb+j7qUXrc8M/+mi4N/x67d0Z0S1daLSANzfFpZj9+ d09UWj6AdJgtgHyn2ace86Pez2pdGLHWNIUxNYsZKQ== X-Received: by 2002:a5d:452b:0:b0:2fe:6b1e:3818 with SMTP id j11-20020a5d452b000000b002fe6b1e3818mr13618694wra.51.1683097635211; Wed, 03 May 2023 00:07:15 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:07:14 -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 23/57] tcg/ppc: Use full load/store helpers in user-only mode Date: Wed, 3 May 2023 08:06:22 +0100 Message-Id: <20230503070656.1746170-24-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::336; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x336.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=ham 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/ppc/tcg-target.c.inc | 44 ---------------------------------------- 1 file changed, 44 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 0963156a78..733f67c7a5 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -1962,7 +1962,6 @@ static const uint32_t qemu_stx_opc[(MO_SIZE + MO_BSWAP) + 1] = { [MO_BSWAP | MO_UQ] = STDBRX, }; -#if defined (CONFIG_SOFTMMU) static TCGReg ldst_ra_gen(TCGContext *s, const TCGLabelQemuLdst *l, int arg) { if (arg < 0) { @@ -2012,49 +2011,6 @@ static bool tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *lb) tcg_out_b(s, 0, lb->raddr); return true; } -#else -static bool tcg_out_fail_alignment(TCGContext *s, TCGLabelQemuLdst *l) -{ - if (!reloc_pc14(l->label_ptr[0], tcg_splitwx_to_rx(s->code_ptr))) { - return false; - } - - if (TCG_TARGET_REG_BITS < TARGET_LONG_BITS) { - TCGReg arg = TCG_REG_R4; - - arg |= (TCG_TARGET_CALL_ARG_I64 == TCG_CALL_ARG_EVEN); - if (l->addrlo_reg != arg) { - tcg_out_mov(s, TCG_TYPE_I32, arg, l->addrhi_reg); - tcg_out_mov(s, TCG_TYPE_I32, arg + 1, l->addrlo_reg); - } else if (l->addrhi_reg != arg + 1) { - tcg_out_mov(s, TCG_TYPE_I32, arg + 1, l->addrlo_reg); - tcg_out_mov(s, TCG_TYPE_I32, arg, l->addrhi_reg); - } else { - tcg_out_mov(s, TCG_TYPE_I32, TCG_REG_R0, arg); - tcg_out_mov(s, TCG_TYPE_I32, arg, arg + 1); - tcg_out_mov(s, TCG_TYPE_I32, arg + 1, TCG_REG_R0); - } - } else { - tcg_out_mov(s, TCG_TYPE_TL, TCG_REG_R4, l->addrlo_reg); - } - tcg_out_mov(s, TCG_TYPE_TL, TCG_REG_R3, TCG_AREG0); - - /* "Tail call" to the helper, with the return address back inline. */ - tcg_out_call_int(s, 0, (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 */ typedef struct { TCGReg base;