Received: by 10.213.65.68 with SMTP id h4csp696986imn; Wed, 28 Mar 2018 11:05:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx485fprM++1BPxoPzcU9SOLtT3ZQDC6sSiOjq6EC4Ak48IaUEA7+GvWxpOquVOh0azW16rSz X-Received: by 2002:a17:902:8492:: with SMTP id c18-v6mr4773548plo.40.1522260342309; Wed, 28 Mar 2018 11:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522260342; cv=none; d=google.com; s=arc-20160816; b=CUVsUIENnVttIk9HOMbJ3Whc5xxdPTcOxv+P37XDx1fBFW/4WxKiA+e0lmURQxq7ia lOa21Fw7pcfwXfv+pOn1zUDh0k9lMRD9Fm3fCLGSzAW5wdD6sWc2Rtz487jn8VrKWWLM uOnRgGThMvgbth5gDmnSjnMF8+fJ9LoXgfKsgZv/BI74v2a/1rDc+OjLgDWxCj+7t/2h VmyNGniwhfj0MYcLIu1bnYgRaHqKw9F6oHUgRxK6uA9HF/Q0NrntyK/8IhqP0gPnOZXB q+oZXfnJ4GkfLjH6eVx6wxM1zB90DBFzm3RBAzc8w2K9Z8g72DU2l0ImVROp3s8mxOd2 GK3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date:arc-authentication-results; bh=1SGpp+TY7XsCSqLVYqK2zYweXVfLxOvTusJuuvSsWOg=; b=sMw5oiSUItciXQL09F9UT7dfxG649On+rJNUC4C4aR7g0/gg3CJoZeF9gk7sM0rzC0 BjgBwBdkU2caXn++8JYlqRNrJlg2hVxtNSvzDuWw1iHLKKaVO3FI3sIq6/okoTIXt/la 5zRIYKT0ZY0dqclAggGJdnVPdfsFu8BQUDVsoBhLfGQm7jRecuwpTLDv7/OZxsOp49f9 f0M1WJGFm5es//WjyAQ4TQ8pYq5c4SFYyNG9TkKg7ljM4wr8VA1hgpGHW8IHC1MSEl4Y O71ilPvuiF0GKqrwzWvsdJoo4OjRnIjhstlwq3Uc5gcbzUulPq17jXbbO3VAr+7ugQMT odMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h32-v6si4053756pld.217.2018.03.28.11.05.22; Wed, 28 Mar 2018 11:05:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753148AbeC1SEK (ORCPT + 99 others); Wed, 28 Mar 2018 14:04:10 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:52952 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753071AbeC1SEI (ORCPT ); Wed, 28 Mar 2018 14:04:08 -0400 Received: (qmail 4052 invoked by uid 2102); 28 Mar 2018 14:04:07 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 28 Mar 2018 14:04:07 -0400 Date: Wed, 28 Mar 2018 14:04:07 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: "Paul E. McKenney" cc: schwidefsky@de.ibm.com, , , , , , , , , , , , Subject: Re: [PATCH RFC tools/memory-model] Add s390.{cfg,cat} In-Reply-To: <20180328163344.GT3675@linux.vnet.ibm.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Mar 2018, Paul E. McKenney wrote: > On Wed, Mar 28, 2018 at 11:01:25AM -0400, Alan Stern wrote: > > On Wed, 28 Mar 2018, Paul E. McKenney wrote: > > > > > Hello! > > > > > > The prototype patch shown below provides files required to allow herd7 to > > > evaluate C-language litmus tests for the multicopy-atomic TSO ordering > > > provided by s390. This patch should be viewed with great suspicion. > > > It does what I expect it to do on SB (with and without barriers), > > > IRIW without barriers, and Alan's SB with read-of-write added, but my > > > expectations are quite likely faulty, and my test cases are very few > > > in number. > > > > > > Either way, this is the easy part. The hard part (which I am happy > > > to leave to others) is making litmus7 and klitmus7 able to do tests > > > on actual hardware, as well as enabling herd to handle litmus tests > > > containing BAL. ;-) > > > > > > Note that CPU architectures already supported by herd might well need > > > only a .cfg file that refers to herd's pre-existing support. > > > > > > Thoughts? > > > > I don't quite see the point of this. You're not suggesting that we > > have one Linux Kernel Memory Consistency Model for s390 and another > > one for all the other architectures, are you? > > Certainly not for common code! > > > If the idea is merely to provide a herd model for s390 then it should > > go into the DIY repository, not into the LKMM repository. > > Makes sense. > > In the meantime, does the cat file look to you like it correctly > models the combination of TSO and multicopy atomicity? Do the > fences really work, or did I just get lucky with my choice of > litmus tests? You got lucky. Try creating an SB litmus test where, instead of an smp_mb() fence between the write and the read, each thread executes some other kind of fence. The acyclicity condition should have been written more like this: let po_ghb = ([R] ; po ; [M]) | ([M] ; po ; [W]) acyclic mfence | po_ghb | rf | fr | co as tso-mca I don't know what the fence instruction is on s390; change the "mfence" above accordingly. The main difference between this and the corresponding expression in x86tso.cat is that I replaced rfe with rf. This doesn't account for atomic operations properly; see the "implied" term in x86tso.cat. Alan