From patchwork Tue Oct 17 06:11:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 734269 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp322930wro; Mon, 16 Oct 2023 23:16:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSjPKO6ZL2gpgAb3aGneU8RJON8DI8T47KENPtMoZ8nhf50Oi4jkSlf1AuA3OEdI3tPTfz X-Received: by 2002:ad4:5be2:0:b0:66d:23e4:2ce6 with SMTP id k2-20020ad45be2000000b0066d23e42ce6mr1602033qvc.47.1697523387118; Mon, 16 Oct 2023 23:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697523387; cv=none; d=google.com; s=arc-20160816; b=r6iQ4Jy7hO0AXZ/ooDMmM8XBbs7czEFl49y2JfAIFqR/F9f4VcOAgkiTqJ3jVjqOh9 T3rDjRwOspluuxpiMyVWfXxWwjv8KwkQXhf/8a6CEr9vQRvjUTBnuFpJelhPe4yIA4R+ 56vdG7J6bxvMj3HJzfN3Z+Z9CYaTA/NnLgIr/Yhp5ZHMkYNF5VhHEoxu0wWijnhyfjpH CXGXiZxMDto3+BsdS0XDpONkmBZBF8MyDfoPlBVCZ6MEWPGMYn2u7c5m6ki8EtI8zGVZ bkERDMLx/8bJk+9FmgyOVig4oI4i+v+virUWr2tWUgfEUGwGloccAUluf6+XR3MoSY2k Y9CA== 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=Xd5Svu0+B7OGG++QiM45a02WgNYRHjpbrT0y5ShkAgs=; fh=GkmytpQ/aBK+SnhsUxtqa1dYh9qnVue5D4c8ejqHfb0=; b=xWRlLepWs3bR58KhCbpnCLupvMpA91lqDppNfvZQBHKptL0VJF+tdTu8rWTO83IvB8 gj/EjYFh39zcTabUnMCpNtvEhgHAmZ1dWklBU0NTXjJBlJbwrHMc8FQkmx1y+wGUTZjc /Zv/z/I1qd/tTQipjJATI+EaTQkLH8sJgMiJtJaTrwdHPsgXb8dM4A3OGFFu8Atmj7vp o/elbt0lVIiRGPnERUtZjzKiULwoLir6Qs1gx7xY/9fY6QeaH8P+VfFtatAGbD65E/il fhNGqtQNPG0jvNibhELxAod4uRnKRRkWVdY/wQF5yGgHJxcGwN5uWNR+zc7Te/spSmDc pmcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WfuHpglZ; 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 b11-20020a0cfb4b000000b0065afce4a725si541041qvq.47.2023.10.16.23.16.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2023 23:16:27 -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=WfuHpglZ; 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 1qsdK2-0008Oe-8A; Tue, 17 Oct 2023 02:12:54 -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 1qsdK0-0008NE-Db for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:12:52 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qsdJy-0003pH-QS for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:12:52 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6be1bc5aa1cso1587059b3a.3 for ; Mon, 16 Oct 2023 23:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697523169; x=1698127969; 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=Xd5Svu0+B7OGG++QiM45a02WgNYRHjpbrT0y5ShkAgs=; b=WfuHpglZnG5ZjPSh3W77/LCOpPSKW5xqHvPwZSTbDp8r3XKXmwyoRp0fLmTfPEUFOf tnicUqPl66+wOUkKCdsbX3o5/GSnbRDgleZXGVtSVpHgvWS4Ng2NYo1EcD4HJ3OHzxCc 73GI93IiNBkTOMQZYvSYxZkpil9JHOJYqabFNREpByufby6sXok0CwHHd/7X5nL1gK8Q jkGrZXFQAnWUXb6o5Sy8ahLf6HT0j6ylD+acncDk88hz0wCBeBOwxKB0N4kqwPQFJpMX PfqGBTNc+cXn4w3xzlB1WKJ4z2W6J+2Tl+U/Ivza6q8UP783UBrwIraAK2KlzMvOL6wB W2cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697523169; x=1698127969; 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=Xd5Svu0+B7OGG++QiM45a02WgNYRHjpbrT0y5ShkAgs=; b=hHJMrGKKgHzxt9EO+viNYkMyQtPBQbHBwB01VuVn9FFbA4b07k+Dn4+NAHCs8GOu0L 4D7vo7teYjLlW9FqSHgiwI2g+bC0tsaHC7lAta2H/3IDPmdocLZYRKjzQ7dCr6BhyECr 1iJIVSxmx2yBLgwLRJuWgvlzsEy0piytXX9UOLUtvLigSPFA7BnDLrL1eGHkTzunbg8Q ikP0kLdetBl+i1+EoWPitf76x0OEPiKNS2RukAq/m0Kwgb/gxtHya0CEsdclQ9kM2Bfc bh09m5P9U1uX3r8YscdorLl6Ug1ePkomFjm4MOYyqfQvQPQhW0xL86ivhdrIo7K4I26C +b7Q== X-Gm-Message-State: AOJu0Ywg+jmtZzhEYr13mM1393gKz+eIrwauGJrTSty3IElu7Lv+0TAi JQvyRhMyKuLnARhxloWZIKBSHYXC5RA+ztoICek= X-Received: by 2002:a05:6300:8086:b0:17a:de5d:1d7e with SMTP id ap6-20020a056300808600b0017ade5d1d7emr1201543pzc.55.1697523169292; Mon, 16 Oct 2023 23:12:49 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id jf4-20020a170903268400b001ca21e05c69sm629150plb.109.2023.10.16.23.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:12:48 -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 v2 04/90] target/sparc: Set TCG_GUEST_DEFAULT_MO Date: Mon, 16 Oct 2023 23:11:18 -0700 Message-Id: <20231017061244.681584-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017061244.681584-1-richard.henderson@linaro.org> References: <20231017061244.681584-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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. 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