Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp207163lqp; Mon, 10 Jun 2024 01:05:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqrDtdwBUOfCOe//Yrk+quyd5I/2uuPqQF642lpHhSKhssr8r+N0Lqju2YGVNcsZaSoSHO+I5YJBWSHDc43QhnRcGxWqWlSbKkNNvdRw== X-Google-Smtp-Source: AGHT+IHLE2HFDG6K09XUsLBGc9Elqtz5cOaEsCMdzB2vhxKl5ulUnfAv0njkHOO2SvE2/lusLzF1 X-Received: by 2002:a17:903:230d:b0:1f7:187f:cb63 with SMTP id d9443c01a7336-1f7187fce09mr11628675ad.47.1718006703138; Mon, 10 Jun 2024 01:05:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718006703; cv=pass; d=google.com; s=arc-20160816; b=XQjbxYsVENRQYKC3hRgwvoTcOtJO/JaeXOKiZN0sCEYQcTqca75vw7gSLfEkhH40n3 Yc7eht9KTSzcaSPV5VLm88q3nr9sQ214YzmKHOHP3SvcpB1ld3fU90Png+/UgRdl5S5D 6nAOeKUD3pnLpO/YgKqAC/20+oAQEWT1skhSx/Fypw9v8c4c7Ny4TgB1qY8bzwn+0zxw VOYDGmorcu2aF4SkbQKJnbPivTTI/h8WvRfa9JxDJiAQ1CxX2+MY9A8hlVxptV7pNxdl qaOEwptMCwvGC/aZyejSgOWvlUyqnGycsffI7yVl2gDPYjOFkg6yyrAP59HbwXMCt7bA grLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id; bh=Ze+Zb/1bdJsbUstw0fFqsBlMujt8bYAkS97JGlSvfEw=; fh=87ektB0aEUgjJ+9ZMreWTm/270aVkBCq03kWC++YZNQ=; b=cyEW8ORoKVOYE+qkFHMG9cbrwvswnD6eJqPW8kHVZSz+JGNWNohNh3KgcgYexpB6Kx yLHec3iIKCqLEsUBQPfg6JPI/MHzG+sazCMGDTVS59BBOFjNlzTDnOvVHU9uYimrYdeG LhyT6Zcby9x6s7CpcJ0B7atVf+E6B6gxpzQY1v35qbZd6f9q8K+aatcrMX6+FK5LrZ/V r0YGMVlArAc7zXDLgdvGYaOHyihOZ+hns4NZ3+Yq0swNW+UlORGTIQmE4vTRvfVEnrO9 diG2XhMKH2xhlboz9Xr30gr7tHbySyS71bIOVkB77crWLHHEzs0eFatglCTQS8xs7dg4 ECiA==; 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-207795-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207795-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd76d148si72623355ad.167.2024.06.10.01.05.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 01:05:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207795-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-207795-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207795-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E771828234F for ; Mon, 10 Jun 2024 08:05:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE819558B7; Mon, 10 Jun 2024 08:04:55 +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 0252B4D8BC for ; Mon, 10 Jun 2024 08:04:52 +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=1718006695; cv=none; b=g1yXwmcxL2fU/zZBukD3M27flNBXKhqwPA1lVk85B2x7a9ZG74ke+RNoHqGM3AaZuuri1XyeOy1yAqpi2MML0JGnQpTWanFdjm1l+GSaHRQ3QT/rIl7lyzg5ovVSLG2yasmtRtKQ+vtzLjvcTRHfdqaDbK8bDEjPzzs2O/MN+wQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718006695; c=relaxed/simple; bh=2OPoc+UK2kuduohQq5i3tqCh18Kok+L5ON1ds87rC1g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EOlWFTlRTBIVlNmF1/yOrUPUqDvdgtZUdQAnyUruNIEhC2ZDFrB14m5tIEZMCMrx8mAmvCWAsIca7M6FBurnxOGiPIAI3YUKRbPyAHH9n43XsTiczSArc086SKqovqnx91qY6C56GDkSIbY39aMttTCRqqLO3JM5LJViuEGACGE= 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 4VyP062jr9z9v7Jb for ; Mon, 10 Jun 2024 15:42:14 +0800 (CST) Received: from mail02.huawei.com (unknown [7.182.16.27]) by mail.maildlp.com (Postfix) with ESMTP id 0CAFE1400CB for ; Mon, 10 Jun 2024 16:04:44 +0800 (CST) Received: from [10.81.205.125] (unknown [10.81.205.125]) by APP2 (Coremail) with SMTP id GxC2BwCHDjmNs2ZmbcchAA--.46614S2; Mon, 10 Jun 2024 09:04:43 +0100 (CET) Message-ID: <1aed7106-cb94-451e-93d1-53062e6f3639@huaweicloud.com> Date: Mon, 10 Jun 2024 10:04:26 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHv2 0/4] tools/memory-model: Define more of LKMM in tools/memory-model To: paulmck@kernel.org Cc: Alan Stern , 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 References: <20240604152922.495908-1-jonas.oberhauser@huaweicloud.com> <88c1ebc8-4805-4d1d-868a-889043899979@rowland.harvard.edu> From: Jonas Oberhauser In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID:GxC2BwCHDjmNs2ZmbcchAA--.46614S2 X-Coremail-Antispam: 1UD129KBjvJXoWxWw48Gw4UGr4fJr13Xr4rGrg_yoW5Aw1fpF W5GayrKFs8Jry29w4Igrs7XFyayayfG347Xrn5Jw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ote: >> >> >> Am 6/4/2024 um 7:56 PM schrieb Alan Stern: >>> On Tue, Jun 04, 2024 at 05:29:18PM +0200, Jonas Oberhauser wrote: >>>> Currently, the effect of several tag on operations is defined only in >>>> the herd7 tool's OCaml code as syntax transformations, while the effect >>>> of all other tags is defined in tools/memory-model. >>>> This asymmetry means that two seemingly analogous definitions in >>>> tools/memory-model behave quite differently because the generated >>>> representation is sometimes modified by hardcoded behavior in herd7. >>>> >>>> It also makes it hard to see that the behavior of the formalization >>>> matches the intuition described in explanation.txt without delving into >>>> the implementation of herd7. >>>> >>>> Furthermore, this hardcoded behavior is hard to maintain inside herd7 and >>>> other tools implementing WMM, and has caused several bugs and confusions >>>> with the tool maintainers, e.g.: >>>> >>>> https://github.com/MPI-SWS/genmc/issues/22 >>>> https://github.com/herd/herdtools7/issues/384#issuecomment-1132859904 >>>> https://github.com/hernanponcedeleon/Dat3M/issues/254 >>>> >>>> It also means that potential future extensions of LKMM with new tags may >>>> not work without changing internals of the herd7 tool. >>>> >>>> In this patch series, we first emulate the effect of herd7 transformations >>>> in tools/memory-model through explicit rules in .cat and .bell files that >>>> reference the transformed tags. >>>> These transformations do not have any immediate effect with the current >>>> herd7 implementation, because they apply after the syntax transformations >>>> have already modified those tags. >>>> >>>> In a second step, we then distinguish between syntactic tags (that are >>>> placed by the programmer on operations, e.g., an 'ACQUIRE tag on both the >>>> read and write of an xchg_acquire() operation) and sets of events (that >>>> would be defined after the (emulated) transformations, e.g., an Acquire >>>> set that includes only on the read of the xchg_acquire(), but "has been >>>> removed" from the write). >>>> >>>> This second step is incompatible with the current herd7 implementation, >>>> since herd7 uses hardcoded tag names to decide what to do with LKMM; >>>> therefore, the newly introduced syntactic tags will be ignored or >>>> processed incorrectly by herd7. >>> >>> The patches look good to me. >>> >>> Just to clarify: Your first step encompasses patches 1 - 3, and the >>> second step is patch 4. The first three patches can be applied now, but >>> the last one needs to wait until herd7 has been updated. Is this all >>> correct? >> >> Exactly. > > Just to make sure that I am following along properly... My belief is > that there will be a new version of this series. Please let me know if > I am missing something. At least one :)) Have fun, jonas