From patchwork Sun Oct 22 23:28:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737019 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1282181wrl; Sun, 22 Oct 2023 16:31:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOkNJ+gqHihiHZ2jKcMvbY7O0/DtUuodpETy9mN0aYhq6Xxvys+BpZIY53iY4xMIxRqwEU X-Received: by 2002:a05:6214:18ec:b0:66d:593e:7722 with SMTP id ep12-20020a05621418ec00b0066d593e7722mr15373142qvb.3.1698017467373; Sun, 22 Oct 2023 16:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698017467; cv=none; d=google.com; s=arc-20160816; b=zybFJ/YXp1MKkKRguVKUpXs7/8ij8LMbdByUclSmYgH0sqBdUqAX25jA8HnzxcXSvT /9Lc795ZIGHHBVzqrSX2Zf2WzkN8DnXiMGs6Bk7UlEbyiSzRJWmOFxCMEzUKq9zXeLJC /uxJv3aL9biN7ehXTTBdWM2NGaqfSObmBiR1R8KhWfiDoGJMs7wVF0jyYzhTAqPLOOnd 0IeQDLAf5NzPTMjI1koqj9IB1Af2DwPq7zebw1yqnziRAofbnvMAMTdUJRfofu/csd84 ft2miVcu3doHCKtPt9xOFMff+9Xii0bsvRpggba8MGikdNDJKoEzoSuxXQDGo+blKGuU ND2Q== 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=+FzEYXMiYUmAnzQhyJLC08QhIql51EYsnrwBv94uD9o=; fh=GkmytpQ/aBK+SnhsUxtqa1dYh9qnVue5D4c8ejqHfb0=; b=OKP1xtOenX0VhtWijgmOiFcz9f5DtFfbhyEHMz5EHgHMUSWveTiiBcRMxwClZcxo61 nhDfJYVs9+t0Zq+mEy1X73US48OZPEXFgfYfe9jOPIw7Nx0yqwJZkiAqIOPCr4qxBryj 5QxQXXgnQRaT1E9uNJQs5dn4oCZA0Dm52S/JxgmN2pw+pET9GNmEHQhSd5W37OaGI9ir YFqF2oYoS7rKBua16n+8f/Z6CWFASSqztSoGa/mGcmLAHNkOygnUq+cp2s/2/+FepHiR MqHG6Wbg4Hb4VoIpVo0ZyyZhEJ3wNkpuu8HBUMsviSeT5h+a/NUNWj72RfEFOZkjHE81 KAfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TcuWPii9; 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 pc6-20020a056214488600b0065afba57627si5016608qvb.186.2023.10.22.16.31.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2023 16:31:07 -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=TcuWPii9; 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 1quhtE-00075c-28; Sun, 22 Oct 2023 19:29:48 -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 1quht7-00072r-TR for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:29:41 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quht6-0006hI-9o for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:29:41 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b44befac59so2724751b3a.0 for ; Sun, 22 Oct 2023 16:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698017378; x=1698622178; darn=nongnu.org; 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=+FzEYXMiYUmAnzQhyJLC08QhIql51EYsnrwBv94uD9o=; b=TcuWPii9aXBmmnZ1dA8K8kMzzZelRyh2z/mzEgh3d61YuQiBgu09AlrbJYSKjVdV6r PQrZNoioyMXl3SGLADCkROC+Xbc4+xgNWkzq2pcfzY1iqjdAL4skAxC7Tjw5Jc1cvoL4 8a9nSUTPZLDgpG+mtbUL2l+C3oyCIiegXuCmLnDsYId+INAJ8Ewf8WNrM92iL4ex4/3r atVYHLYRh8X/0w3dnp+FMcnoQoMcoWVHcm1W0sGZTSjeD2n0Y45rlUqYnFpgaZwhi0Vm swnAVFPzmiy2OVyYs9pQ8+LNI4hsc9YOY+X9GMGm7Txo7I7POq4zHUnhBFylfWGihec1 HOjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698017378; x=1698622178; 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=+FzEYXMiYUmAnzQhyJLC08QhIql51EYsnrwBv94uD9o=; b=TmdTV86uJcPcJJRiXI8te5EAiuPM2KHd3qrwwU7Lsqd+s4+fmHidazQlDbfLQpPj4d QozRW7iPwvmfC6gEEGR+l+CyDtFouQ3ZdniRSb6ZukzeoiLzGSKCGwUS4Y5J8IGYR8cX 1JUHmiaPy+2Q0ZTnE8I7deDCeWsus/OlqxpgJsApoYXIF6ZcyyqXugO3q1DogXwk+QfN GI9z87nKkO4Nsqr2jR1GMd4B3vyAsl9tQPuK+roJAEqMfkl6zus0KXUIOF7l/5AW09Rm JW0ICn5ylkdHMpKwcpdUrRdziog7W08oypwx0+/P/xDiY8mbOu/GXpL5dHPug2GCdaY8 4kOQ== X-Gm-Message-State: AOJu0YyCEIRSe2DsrIi+ognYQO9AliX0f5tJPtFUonUB1TfwC12fUg+h QA1cCbx/9IDUSQhheUeCciPqpLYriYn+EvmUBoI= X-Received: by 2002:a05:6a20:e107:b0:158:143d:e215 with SMTP id kr7-20020a056a20e10700b00158143de215mr15071887pzb.1.1698017377769; Sun, 22 Oct 2023 16:29:37 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k26-20020a63ba1a000000b005b25a04cf8bsm4023772pgf.12.2023.10.22.16.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 16:29:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v5 04/94] target/sparc: Set TCG_GUEST_DEFAULT_MO Date: Sun, 22 Oct 2023 16:28:02 -0700 Message-Id: <20231022232932.80507-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022232932.80507-1-richard.henderson@linaro.org> References: <20231022232932.80507-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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 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 Always use TSO, per the Oracle 2015 manual. This is slightly less restrictive than the TCG_MO_ALL default, and happens to match the i386 model, which will eliminate a few extra barriers on that host. Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/sparc/cpu.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index b3a98f1d74..9fc5c401d2 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -6,6 +6,29 @@ #include "exec/cpu-defs.h" #include "qemu/cpu-float.h" +/* + * From Oracle SPARC Architecture 2015: + * + * Compatibility notes: The PSO memory model described in SPARC V8 and + * SPARC V9 compatibility architecture specifications was never implemented + * in a SPARC V9 implementation and is not included in the Oracle SPARC + * Architecture specification. + * + * The RMO memory model described in the SPARC V9 specification was + * implemented in some non-Sun SPARC V9 implementations, but is not + * directly supported in Oracle SPARC Architecture 2015 implementations. + * + * Therefore always use TSO in QEMU. + * + * D.5 Specification of Partial Store Order (PSO) + * ... [loads] are followed by an implied MEMBAR #LoadLoad | #LoadStore. + * + * D.6 Specification of Total Store Order (TSO) + * ... PSO with the additional requirement that all [stores] are followed + * by an implied MEMBAR #StoreStore. + */ +#define TCG_GUEST_DEFAULT_MO (TCG_MO_LD_LD | TCG_MO_LD_ST | TCG_MO_ST_ST) + #if !defined(TARGET_SPARC64) #define TARGET_DPREGS 16 #else