Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp139656lqb; Tue, 28 May 2024 11:00:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQerbSmySWcKGlNDVwItTK2rtGcYQge4z5nZSJA1wlRU+nFDO2eDw2CuXs9821fNXSCLYEHBSvwsuCT2e8ZtMiiB/tP/tkJAuTV+2+XQ== X-Google-Smtp-Source: AGHT+IF9mtdBw71aBQrMPS01/SHcmgXI7Z4RzDUzaVgu1sxX02nuX7Debi1YDN+ubTSbaldpFesd X-Received: by 2002:a05:6a20:5520:b0:1b1:d7b3:dc57 with SMTP id adf61e73a8af0-1b212d462c2mr11685114637.33.1716919224616; Tue, 28 May 2024 11:00:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716919224; cv=pass; d=google.com; s=arc-20160816; b=vKHYrdGiq2s4dEUnuUYFN1q0zGZYtWJJXzU99QXKLShRxMkrvivAnjuo1AKGbFauHV HU3lisBJC/3fIJ2WxQaod8bXvPcPPz7mZBpMw9uKqK2jJ/kya5XHj7i5DhaRNWhJ/BN7 S556y8+UfxNdanOUF/+QQ22N67K51rO1vsnuDpqNr26X1fF5gOQmDFbo/8amYF7qFf5B W0df+Xcru6EBD7vmDD9a9DjUVygLy8YiKE7o1oZHSroEA3WRTtP9DV+f/EZxaOqe5O9w qDvw3fVpS+UQ9aTCXgfDwfdr/6IzSy6HiH/Z24Q5G/KCDQoqYYhxgkFz4j6vLpePBLJM GtZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature; bh=T9CcbgCubAJ73RNKrfh6CLd9MLYV3LALBDGHRnXyNZ4=; fh=y4s475JBmOFBgyHZE49Ih6KzZafP0wPtO0+6Hz16cnI=; b=EhWjpEa6659PsxR23J+O++6IT+qx6jXqTqsJAXV8ubliV0Z6I24WYLXf1IQIMAey9I SrLaoM75fCZRnJPGfVWMHhBfDRqdhNxOAsPPw8q+5eNxwAH5Aus+VNvQjJPsvGN/RxCq 43d9fqbLJnblmOtgY9R7NojBvD8/4DrAQ4ASy1GyZKG0v7jT+3I7nAwcPrG1BtAwX1Lh 3KhO5R9r5ciIHDyOmGICh5AZW6ft1NezP6TtlAng0wo+qjR4TeokE7WXgH5/OW7rriF3 GGd5YAPKRJ879lWF+hnNkC1JG2oKeIzu/UjwIMV6D7LW5InT9Yv1TTzfwhJNrePgoijt 9yWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VJpxeOwJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-192835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-682288e7a30si8447452a12.518.2024.05.28.11.00.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 11:00:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VJpxeOwJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-192835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8FF54B22431 for ; Tue, 28 May 2024 18:00:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5288247F60; Tue, 28 May 2024 18:00:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VJpxeOwJ" Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D58644C7E; Tue, 28 May 2024 18:00:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716919215; cv=none; b=AZRnTU0Rv6JoHo2aMHEfonGmBhCjLnEBk5y29vafojJFBoBaFCHpjMuZL4zA4uzk/GHqOus40lIn5bulLmYqYb67yLWlrpzbAIvCkpx7RdQSkpPBHFnMg2D0TkNgxkD5l+uWbsiEfJwVYgcrs2jLrZch+WqGL6iR3A83Mzm6IKI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716919215; c=relaxed/simple; bh=+SMLwVcqLRSmG8T75XqR3w6eFstMjRzAAFgHYK+96eE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cHtYRtFQKYhbPHo8cscMC844T0olwsyQmVLbGhghWW/juKE+bj01ZdRApBd0cc9SSDhzm3qECwXczLzJ8f1TyXVwmMvEpSfvIs/0ZHTNpae634ET+qKvQNRQ64wnjgFsmYsyzZ+mxRK0TFbejrqItBwp0kEHzb/pdYwHgLXt9X0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VJpxeOwJ; arc=none smtp.client-ip=209.85.210.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-6f8cd25ebd5so498948a34.1; Tue, 28 May 2024 11:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716919213; x=1717524013; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=T9CcbgCubAJ73RNKrfh6CLd9MLYV3LALBDGHRnXyNZ4=; b=VJpxeOwJlcZGL2zDUNi/6MPcL7e2Dc6QbTQjV1vp51FqbJDvEx0PgERyGFzl+KI17z zCCY8oiumNd672vT6dSZtzBdtu/aLXrL7Py3oRJDU4oh9by440EwUs0PaRhZJ85N/fyk LlJKEDlPV40/wFxUqx0On4zivZUJzKI3e5DrgKrQq9Cm67c0WrSNClXRz/tRipdlR8Io bSlKjz02iF5S8lGt8XOHDBl4x1YpASoMRBk+F3E7CmKi8yi4o6vFUN85pawvxalUm9a/ srIb0BGISS1DSZcPi6tILjLh0hpp5CJMa8i2DMwaa4HQipEUS7YakYihLlJvWJupTPMq hBYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716919213; x=1717524013; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T9CcbgCubAJ73RNKrfh6CLd9MLYV3LALBDGHRnXyNZ4=; b=j8DQYFL1xhYJDD3q1VHF+G2feGXFweEgT5mumw96B8F77W8Ri2TZmEoRIzyqV4z67i r0DHYSDDAKiYLSsYCfcpcMESsFEkwo93zhxoQcjeMSCYyYlzfZB+a2zX54C/XHrNaTK2 fVWgwpSAnbuQVf67r+AGx1IMOJGM7fP8tFEkIyOC9tNEsO6jgvyEAfDVHFCy0T2fc71e NFY3XTzWREhGT06oWzscFlWtw+nGZjyIz5ZjDA8UCLo5GTJWEyZSWS42kaQ8Bx+QImqB JJu9TxkQUj/5nns9UHs32VFAurOQJ17TBCUceFPzgBRzQVD67uCNdlLjZ5Wu2eWIbC7v EirQ== X-Forwarded-Encrypted: i=1; AJvYcCUAJ1jsMzJllmOLKc366dIiDAxAO+glP6NFk9x+mbQlC2357rBbF4JwEzSPQ1CHq0dZgB0q89ouVN5QqSU2He6d15pOd0Ku0Pew22dyJE3kVSZzuAzzR2Os/pcXEUUv9M2X1xIP/CZsew== X-Gm-Message-State: AOJu0YyAjkeRI5QUo1KKeiCX8m3Tj5kxbSEC2syIYA8uSE8euSFjH/3+ loBtcCbHolgqOS2jADSYtbRIfvDCLlmnlsp8rV4lN/AP8Tyak/1s X-Received: by 2002:a05:6870:218d:b0:24e:6d33:9e1a with SMTP id 586e51a60fabf-24e6d33a0c5mr11547793fac.12.1716919212597; Tue, 28 May 2024 11:00:12 -0700 (PDT) Received: from fauth1-smtp.messagingengine.com (fauth1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id af79cd13be357-794abca7f80sm402204585a.21.2024.05.28.10.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 10:59:49 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfauth.nyi.internal (Postfix) with ESMTP id 7C4721200032; Tue, 28 May 2024 13:59:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 28 May 2024 13:59:33 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejkedgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtrodttddtvdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeeitdefvefhteeklefgtefhgeelkeefffelvdevhfehueektdevhfettddv teevvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 May 2024 13:59:32 -0400 (EDT) Date: Tue, 28 May 2024 10:58:53 -0700 From: Boqun Feng To: Jonas Oberhauser Cc: Andrea Parri , Hernan Ponce de Leon , stern@rowland.harvard.edu, will@kernel.org, peterz@infradead.org, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, paulmck@kernel.org, akiyks@gmail.com, dlustig@nvidia.com, joel@joelfernandes.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH] tools/memory-model: Document herd7 (internal) representation Message-ID: References: <20240524151356.236071-1-parri.andrea@gmail.com> <1a3c892c-903e-8fd3-24a6-2454c2a55302@huaweicloud.com> <41bc01fa-ce02-4005-a3c2-abfabe1c6927@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41bc01fa-ce02-4005-a3c2-abfabe1c6927@huaweicloud.com> On Mon, May 27, 2024 at 03:40:13PM +0200, Jonas Oberhauser wrote: > > > Am 5/27/2024 um 3:28 PM schrieb Andrea Parri: > > > > + | smp_store_mb | W[once] ->po F[mb] | > > > > > > I expect this one to be hard-coded in herd7 source code, but I cannot find > > > it. Can you give me a pointer? > > > > smp_store_mb() is currently mapped to { __store{once}(X,V); __fence{mb}; } in > > the .def file, so it's semantically equivalent to "WRITE_ONCE(); smp_mb();". > > By the way, I experimented a little with these kind of mappings to see if we > can just explicitly encode the mapping there. E.g., I had an idea to use > { __fence{mb-successful-rmw}; __cmpxchg{once}...; > __fence{mb-successful-rmw}; } > > for defining (almost) the current mapping of cmpxchg explicitly. > > But none of the changes I made were accepted by herd7. > > Do you know how the syntax works? > This may not be trivial. Note that cmpxchg() is an expression (it has a value), so in .def, we want to define it as an expression. However, the C-like multiple-statement expression is not supported by herd parser, in other words we want: { __fence{mb-successful-rmw}; int tmp = __cmpxchg{once}(...); __fence{mb-successful-rmw}; tmp; } but herd parser doesn't support this as a valid expression. Regards, Boqun > jonas >