From patchwork Mon Jun 19 14:23:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 694014 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp2398896wru; Mon, 19 Jun 2023 07:24:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5MAeOJeHckjXZaEORdfgl3WWwOz8a1OxdxJhtK6L/VtZ10FlkOQbGBeMsAeLaiXCfq2+tR X-Received: by 2002:a05:620a:8bc2:b0:762:5965:c41d with SMTP id qy2-20020a05620a8bc200b007625965c41dmr3670392qkn.28.1687184673126; Mon, 19 Jun 2023 07:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687184673; cv=none; d=google.com; s=arc-20160816; b=nbXn6ibs8B404EDclH8KhajkRrpQwjxDhocqc0jtpCdc95Vx+vO/gnNBDDa3cpy88h GeB0qTqih4twb4vqSCqF+xxvvVQixEnO0r4uzVoFb9iz0ngjOvChR0ZfExpLIsW6dy1d /eZAbWpBF9XDv11BbNg6RKEvwSXJHF1r+GcqtjP+ZIMouQcKMRAUb8CyBrqGOveqpR5q 7JVCYuCEU38cGurDuEfyRsqF4bIOjdqLNGI3Gmd8JWTxz4BGEBJOJkEHraf41RXYClXa fWF/n+kyUTmbEiVq9QKJIrhZGbronBYv+67xFUuNcv7/rDBP24nbOdVml6zlIVptOi8P PnPQ== 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:to:from :dkim-signature; bh=pwqG4bOndCwR7WWKOm2/D1bdEjIJvQWtHJFzguX9raY=; b=g0Bl15FfYBO7Zt0yIATD+B+o1b/FDufHySYMyKtlSmsiNftszeXywd3RfhJj3JtDHf 25oNmxSaJHZ7inDorC3kc6XJgmmk6L5ePSKTMFk7Qdv8FWE2SRFuviEBHjDmQKj1WR4V Dbeusheo25xRHELtg5eOieAp8Hvg8X+2UHcHkw6/aa55jjbzT1qhh1VpDihERUivtXp6 ygcUpkCZbaHXOQGM255m9jiWxPA+ppnMQ4S0q7E+qMb570D3TFdW4NDtKODIr3Zr98AB TDmQOfvP2tbnoWsyFsKDevNFsGPKlj9buQ6YNpe8rUj/6d7Ky4blCybN1w+miZKviupx lF4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wgMAUfaq; 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 bn38-20020a05620a2ae600b0075b0f18584asi13200334qkb.445.2023.06.19.07.24.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Jun 2023 07:24:33 -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=wgMAUfaq; 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 1qBFnM-0004Fz-0J; Mon, 19 Jun 2023 10:23:52 -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 1qBFnG-0004E4-Li for qemu-devel@nongnu.org; Mon, 19 Jun 2023 10:23:47 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBFnD-0000kl-FO for qemu-devel@nongnu.org; Mon, 19 Jun 2023 10:23:46 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3f90bff0f27so12017835e9.1 for ; Mon, 19 Jun 2023 07:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687184621; x=1689776621; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=pwqG4bOndCwR7WWKOm2/D1bdEjIJvQWtHJFzguX9raY=; b=wgMAUfaq3czt70PcOIIf0zuUDTpaGVvWHb2rTR92yNK5umgGeahY2ube/nakNCj+kF B1RyNPF1T+o3xvxGJwJv4XPuDSqtNtjFXL8HC+cbS8mqHFehzUYBmYGPy1IQkJFiRFDO zg4eWXCXG6Apa+GxWfT+D7p8ukViSSCxt/kCzz+wjYPX2JOCuZ0BOex6JS4YrGa9C4bw 3i5sze2VlCm0EhBgkxGHARd9c6OY4+9wotF9bt1tgQ+1x7P6fAI+ESp9kOT4zwUb9V6F h8cUUaH+yWASvGUvwAnGUiLRNyql18DPjwGDcy/SJoEADXQhE9cTLe9BRLx/4FsWlnJt 7GJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687184621; x=1689776621; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pwqG4bOndCwR7WWKOm2/D1bdEjIJvQWtHJFzguX9raY=; b=QR3sAgIhnWflHl5QqP/ZP58jm3MSFsvm66Ucq5DwvqiLvldOGb4Ushinbei5PCaPmf Z0SD0mv8ePrrN8QGIEu/0zcWKEh+AvYKHfhh1hytqUwaSEv31NqGVqNqK/gcAQcUPkBP it7bp1OtR3af+UsVyfi/94CVZEGo2L8+pu+ywTGqpoM61lO7fBVmMdcX8qRM3i698USo NLFISAUznlp6fWzbZkANQCBOz6DmtqQLLT59e9l6p+ygBeB2IszmHRiHYlwgvh4yp1Ya mJzfODDBX7wLDbVLo/SFyNEkVjEijkKbb0oj7Y5d72MLoR6brMlewyFBRUtlE2HKGCAT +T9Q== X-Gm-Message-State: AC+VfDwFGeHovCorN5EybXviWEtjO1/tg5Gd+Cj4O5qP8fPKO2Sg5Iz/ ZxvhTG6AuymE4pcwIlPSEMyQqBx9C98Z0RP0+3HPFkMu X-Received: by 2002:a05:600c:3799:b0:3f9:b540:862d with SMTP id o25-20020a05600c379900b003f9b540862dmr278293wmr.28.1687184621344; Mon, 19 Jun 2023 07:23:41 -0700 (PDT) Received: from stoup.lan (sar95-h02-176-184-10-225.dsl.sta.abo.bbox.fr. [176.184.10.225]) by smtp.gmail.com with ESMTPSA id k25-20020a7bc419000000b003f96d10eafbsm4143467wmi.12.2023.06.19.07.23.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 07:23:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 3/5] tcg: Elide memory barriers implied by the host memory model Date: Mon, 19 Jun 2023 16:23:31 +0200 Message-Id: <20230619142333.429028-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619142333.429028-1-richard.henderson@linaro.org> References: <20230619142333.429028-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x335.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 Reduce the set of required barriers to those needed by the host right from the beginning. Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 7aadb37756..574001c221 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -115,7 +115,11 @@ void tcg_gen_mb(TCGBar mb_type) #endif if (parallel) { - tcg_gen_op1(INDEX_op_mb, mb_type); + /* We can elide anything which the host provides for free. */ + mb_type &= ~TCG_TARGET_DEFAULT_MO; + if (mb_type & TCG_MO_ALL) { + tcg_gen_op1(INDEX_op_mb, mb_type); + } } }