From patchwork Tue May 16 19:40:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 682383 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp18013wrt; Tue, 16 May 2023 12:48:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5fIQDNTuFgOf023gcxLM6qPpxLT+c5dhSp4TQm+1kE7sa0GF1spvrNYtXqlhDrOSkqLVDy X-Received: by 2002:ac8:5a85:0:b0:3f0:ab4e:df6b with SMTP id c5-20020ac85a85000000b003f0ab4edf6bmr56095471qtc.67.1684266532302; Tue, 16 May 2023 12:48:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684266532; cv=none; d=google.com; s=arc-20160816; b=iqxKzHTEbx0Ty/BfjYYlNveXvDrZ9yzakW6mOf9c4X9uqfdOf+fHb1JJ3Z17DMUGwn W76+3x+QFEtVZV7CPt1zd3BpIQ163HpJ6/ijdVlZmB1j8euytg+CC7e7ZAPueO7buTPC mIuun7VIOiEB1xhyWmh8puY2F2tq4LEXgk6Aj/6l3uabjmPQ1hU1n9XKrIMjzWAIHLGQ 5njuQtadyoUAd923eJBn+QqgDkw9wKHuqYGWqlBo5WpF2dW5nfuwS41v9pZHgXTJnPbW t4pwDehS4a+YlDqOSGwQdUXUEEzqMXceSPmGX+LZdL11n95UoDZIGa9VWRkbXf3N4fsc SA+Q== 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=EAy5XbfXYPrm/J1tRB5DUCT9JP3KNW8vRC1FRgDgvtM=; b=w9ovZzNgzLelMwBArc7kiWu8DusTBI63xPVGJdAJSm/WZCBMTmB/WSsjmzdXCUxppt m0uklv7LIliHsaTKVV8s8sfDtnCMSM6UTL1B6a5IP4IAbkdlOyei3btOhahqJaHFmmH3 X88istfQXyHWARaPEw8hSqAiuCrkn/953wYwsUAXN+JBgwyGHvHzVI66m1IjFMeXtRpJ p4ypbf8dpeEZf9p5crACwRntR537lKH4Zsf/8JCDHfIs2gZk9RQNBnlB1VLfJvZMNHiU UicfgvxmktdF5FnxK7AYWSfUQPGWtDeRCoRwkOvfbPsJWZ17zpKSM57ojrNCjerKhbGz EWbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l9G11aPY; 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 d18-20020ac85d92000000b003f4f44d9676si8142768qtx.615.2023.05.16.12.48.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 May 2023 12:48:52 -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=l9G11aPY; 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 1pz0Yg-0006gG-FS; Tue, 16 May 2023 15:42:06 -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 1pz0Yd-0006eY-Lx for qemu-devel@nongnu.org; Tue, 16 May 2023 15:42:03 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pz0Yc-0002oP-2K for qemu-devel@nongnu.org; Tue, 16 May 2023 15:42:03 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-643b60855c8so12646824b3a.2 for ; Tue, 16 May 2023 12:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684266121; x=1686858121; 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=EAy5XbfXYPrm/J1tRB5DUCT9JP3KNW8vRC1FRgDgvtM=; b=l9G11aPY7zvMYkC060Xfq9uCYZYAWU5DHnoZ6Ukg7WkDOeUdrWLGibcXcPZo53PeJI 8lgXx4wsfDmbn2DLeyuNN7h34ovZBJEgRHeUTELQx/hA9QqGBVr8AynYixl3nWtJK2Du gwfI8e7bKO0w/3UDGYNvIzdRdrxAu1m6Jgk3KAD7/R19QFZHHye2ARpHNo/VGgg9eXn6 ohLNGPHHBfBS7a64CIn9a4TM7VWrDNFXhS+mtl/AfAFQ55sLRWdeoidkasGDggcke6df zUV0seCX4bz1FQB22Nl0vRQ5HnnUofL8JqE6ZXkKqT1TXguDtUhTIssX5Uc2zGElTnp/ KcuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684266121; x=1686858121; 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=EAy5XbfXYPrm/J1tRB5DUCT9JP3KNW8vRC1FRgDgvtM=; b=hsCfaIcHXaGdmwbD2hNH7Xp6IV7AYyFS0GGTxE6UmHx99+dqVD9TdmmGYAEVC2IS7R KmLaEuxgVPHRvvEjN9CPaZ1ldlI4piZ7h5hWn2zvF/e4h8ircU7CskTgbCxdMNMDrx8f rcamsoCVUQ7qZB7a64FO8Ux0Z75r3B7t7QbdBjm/EG8LX7i3jCUipSLSwscq6Aam1KUb hkt5hD2rPpKfAVbBIjCDLqEE5jtmmnZ4b77UmSZDBlFu+Scxbuzcc+xI57EQPW9ktqGV V99eqTvjvVlM0NT0XngSz3QFAVvAerDTL9cvXRA/zVNlMVmyb6SZDLx2+fdW62zyN3Jp 9Oxw== X-Gm-Message-State: AC+VfDyA7aElx6Ogzs1oLLftHDNzb9K3mUVgGPaAMbtcShzumNiXuuvm +/oWoymI2rtNQyG8ioNecHp9c3B+Bu8Y1YB46Qs= X-Received: by 2002:a05:6a00:b55:b0:648:c1be:496 with SMTP id p21-20020a056a000b5500b00648c1be0496mr32881741pfo.22.1684266120845; Tue, 16 May 2023 12:42:00 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:ec81:440e:33a4:40b9]) by smtp.gmail.com with ESMTPSA id z21-20020aa791d5000000b006260526cf0csm13771165pfa.116.2023.05.16.12.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 12:42:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 15/80] tcg/ppc: Use full load/store helpers in user-only mode Date: Tue, 16 May 2023 12:40:40 -0700 Message-Id: <20230516194145.1749305-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516194145.1749305-1-richard.henderson@linaro.org> References: <20230516194145.1749305-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- 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 6a81916e64..218602c10c 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;