Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2119285lqb; Mon, 27 May 2024 08:25:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUgc6LwLExWyl3uuJjGGxm2oex8CguP4uumZk2BboVVotAWsxmlnQ3PV3A2/i3+XgTK9onb+5z1fmi5+nw3vxoE6C1k1s+KKBeNAX2gNQ== X-Google-Smtp-Source: AGHT+IHVryEvgelMdjPk9739WmJjG+06fropyWXZGEtGAQIa2XDNn3n5ttOQqmufWzsg9e6i46gP X-Received: by 2002:a81:ad58:0:b0:627:e281:6763 with SMTP id 00721157ae682-62a08df7b8amr110731697b3.14.1716823557784; Mon, 27 May 2024 08:25:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716823557; cv=pass; d=google.com; s=arc-20160816; b=ZdE6XK5VYDcyd92KDoXRMVPYcI2+8jfZeaiF1b0Jv5U9Y0lCwkIeXo2zOLKfUMZiro vCsb9spffv3x3lfbP4p0dP5B64tWlglHPDFCCkn4HpUVz+up5r0xsHQFh6IuiQMUEryd KQlLUXtGml0ziSykDctN9G5ItM16xN1wR0vUqXF7G/x1mzJztZuk1R0IwbG/K2RydGba cjWj+CJ0BpXkcoE1s6Qvxz5/2uCvGIplIUKvbLM1YF6R5gOtXZZeyUc8fVUSSvv3HBm0 Vlu3yLzi+tmuXp64fiiV0wfimVzgxcuXBAM2ilQyMP8Fr/73H+Cx9RVzwzVQRA1ad2oK RbZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ApF1VbUZrYbxNMZ1SXQVVM9Nks6wQfedOJcDOhtTX2Q=; fh=PokYFa8Et7zdczSF6n+1+UiesnJpST/3LrOOhys0ax8=; b=JK/N52KlC5KuYAWohCWk8sg6JMbVdMt+iNUVS1v6uwrfcRMNCjWuNi1VV1zViVaF7f Xm76gwdufJ2NlbkbDCTREaBWh/FOoftMs75vv2Pt+V5c9ANmksdxsvV4AYFu7XQnVc8n a1cmSCwNIggrluSmYq9y9CEUa/68+6BC3Ucw6Iwl6exppLaich95HJFzKHOZBts/riph NLGXd7VDENr5qOkJ1NuBa2uzsGsnuwDy/demg6l1Y71nefvjDkRXP/N6AE/4NzzfG8sG YmN8d9hOyJV0Q3nDB1/8kPKrlXLjkjmXDlwhwJXoLRMNIReC9lrZqeJfqtwne1SDd0ig 5fXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-191063-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191063-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abd4d784si795442685a.590.2024.05.27.08.25.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 08:25:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191063-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-191063-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191063-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 48C551C21258 for ; Mon, 27 May 2024 15:25:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6F7A61FFA; Mon, 27 May 2024 15:23:57 +0000 (UTC) Received: from frasgout12.his.huawei.com (frasgout12.his.huawei.com [14.137.139.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 891F461FF6 for ; Mon, 27 May 2024 15:23:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=14.137.139.154 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823437; cv=none; b=MrOmFVFdxO7dV0/fYpyPzQvIpR0/wC8vaNC07uCNXk5Gqv5uyY2lQm+gvRI1N/jO6b08I9/MK4CmzKf2hXz0QnENUU+vxiNO4NsNFEcbgZ06JoEpgYOdUiU7+e654gIzA0C/kGLNFD2aFmLONgLMJV6lrDkS3s9RnanO1uBnWyE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716823437; c=relaxed/simple; bh=0xHMFCV5yP3qe4unc9YAGElnXn9fL7ClqpQqFLGvio8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tSdem08gC/27ggVptZ8V/zzSvUnfKjA+5yiN9TPifWo23hrELjfRQtZZainWpdD+TSiFpvW0iSpmgX4NMitOSnsYV4o2cGRhs4Lj9su0TwN4HTNPCq/Mgnp6iOEF9rUpzqONFLo6ILR1s6MhpMO0b9/tewx8yLhE37SFJVVvpII= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=14.137.139.154 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.18.186.51]) by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4VnzPk5WD3z9v7JM for ; Mon, 27 May 2024 23:01:46 +0800 (CST) Received: from mail02.huawei.com (unknown [7.182.16.47]) by mail.maildlp.com (Postfix) with ESMTP id 925C2140485 for ; Mon, 27 May 2024 23:23:46 +0800 (CST) Received: from huaweicloud.com (unknown [10.206.133.88]) by APP1 (Coremail) with SMTP id LxC2BwAHshpgpVRmXLgGCQ--.41702S4; Mon, 27 May 2024 16:23:46 +0100 (CET) From: Jonas Oberhauser To: paulmck@kernel.org Cc: stern@rowland.harvard.edu, parri.andrea@gmail.com, will@kernel.org, peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com, dlustig@nvidia.com, joel@joelfernandes.org, urezki@gmail.com, quic_neeraju@quicinc.com, frederic@kernel.org, linux-kernel@vger.kernel.org, Jonas Oberhauser Subject: [RFC][PATCH 2/4] tools/memory-model: Define applicable tags on operation in tools/... Date: Mon, 27 May 2024 17:22:51 +0200 Message-Id: <20240527152253.195956-3-jonas.oberhauser@huaweicloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527152253.195956-1-jonas.oberhauser@huaweicloud.com> References: <20240527152253.195956-1-jonas.oberhauser@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:LxC2BwAHshpgpVRmXLgGCQ--.41702S4 X-Coremail-Antispam: 1UD129KBjvJXoW7WF48tr4xXr45XrWDJFy7ZFb_yoW8Aw45pr Z7X3y5KryUtwn3Z39rJ34fua4rWayrGFW5Gr92k3srZr98XrnFya1DXan0vFZaqrW3JayU Za1jvFWqkw4UCrJanT9S1T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ads, writes, and read-modify-writes by eliminating 'acquire tags from writes, 'release tags from reads, and 'acquire, 'release, and 'mb tags from failed read-modify-writes. We emulate this behavior by redefining Acquire, Release, and Mb sets in linux-kernel.bell to explicitly exclude those combinations. Herd7 furthermore adds 'noreturn tag to certain reads. Currently herd7 does not allow specifying the 'noreturn tag manually, but such manual declaration (e.g., through a syntax __atomic_op{noreturn}) would add invalid 'noreturn tags to writes; in preparation, we already also exclude this combination. Signed-off-by: Jonas Oberhauser --- tools/memory-model/linux-kernel.bell | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/memory-model/linux-kernel.bell b/tools/memory-model/linux-kernel.bell index 1b2444cdf8d1..08fa1ccb1328 100644 --- a/tools/memory-model/linux-kernel.bell +++ b/tools/memory-model/linux-kernel.bell @@ -36,6 +36,13 @@ enum Barriers = 'wmb (*smp_wmb*) || 'after-srcu-read-unlock (*smp_mb__after_srcu_read_unlock*) instructions F[Barriers] +(* Remove impossible tags, such as Acquire on a store or failed RMW *) +let FailedRMW = RMW \ (domain(rmw) | range(rmw)) +let Acquire = Acquire \ W \ FailedRMW +let Release = Release \ R \ FailedRMW +let Mb = Mb \ FailedRMW +let Noreturn = Noreturn \ W + (* SRCU *) enum SRCU = 'srcu-lock || 'srcu-unlock || 'sync-srcu instructions SRCU[SRCU] @@ -82,4 +89,4 @@ let Plain = M \ Marked let carry-dep = (data ; [~ Srcu-unlock] ; rfi)* let addr = carry-dep ; addr let ctrl = carry-dep ; ctrl -let data = carry-dep ; data +let data = carry-dep ; data \ No newline at end of file -- 2.34.1