Received: by 10.213.65.68 with SMTP id h4csp1141784imn; Wed, 28 Mar 2018 21:56:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/jZ4pcitBMK6pfSwYpE0yb3Y6ELN9+Dgynaf2iOePmGj196JYYLw9D4wQ/7PdNyuYZspk6 X-Received: by 2002:a17:902:6b02:: with SMTP id o2-v6mr6825190plk.334.1522299411956; Wed, 28 Mar 2018 21:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522299411; cv=none; d=google.com; s=arc-20160816; b=CTMVCwaycqtEbuxHvjWhrGMrCn5ideAxk+N3x2vmMnVqrkYqov6tWyNEn65GvtgTC5 o0V02LcM5s9Ls9pP54dzokIV6WXWS3DDoWMH6RR9XqFv8tUubBmprN/Va+vGPZHgL0fy NrYW1WxP3ga4akV6WscQkMTuhQPEtasj4PHZGm0i93XP9hQ4CbziqT8knB+NBA4UB3vB 45CwjQo/jqxmNnxUPHfpcqcCyaUr2J+vst/BZ5uRienBxrhuPFhkERGYILbiEX3cmWfU BZazZRHhu4OFCmnPFCCaihTqUeLlTv7/m7QrL65R+ALvG4nFSkgCvSZXc4JHV6YCXZbP NNBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=0odTthFJXXL1uyMeolxkiDGPgs43ulXkB0T+1ZsI7cE=; b=XzmuZY698yLSEkoW5vPr0OU+BRcl0GHQDcx2fqT/RT+ZX+cVZbKIe3tgNdg3qpPstq Tk8p8ClM0wqICfHRknxZiBjZZTg5fP09MO8iIdGT5nZOU40eiZIJTtO+qEB12bUX25Mm i8hWVxb9UbBsuPVf540QQCM+FbDggsMsTTWqjUBI/4mgbqNY0ZM1mCoDbXhk0a25sOcT JtgzX1qfkAgoIpgl5Yl5EgAse4FHkfsj0esEX2jBTaSijuVoR3q+0LPb9GK6+o+SHzxR UDjufhwzoVE1AOPLPUfgi3ElZZaY/SsCqtWGq1SkrUt5KStWOe1y8kMgc+CB9Vg2Uues 3QVw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9-v6si350829pln.442.2018.03.28.21.56.37; Wed, 28 Mar 2018 21:56:51 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752222AbeC2EyT (ORCPT + 99 others); Thu, 29 Mar 2018 00:54:19 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34350 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752166AbeC2EyR (ORCPT ); Thu, 29 Mar 2018 00:54:17 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2T4sAE3138033 for ; Thu, 29 Mar 2018 00:54:16 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h0hwceusk-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 29 Mar 2018 00:54:16 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 29 Mar 2018 00:54:15 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 29 Mar 2018 00:53:54 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2T4rrgB51839192; Thu, 29 Mar 2018 04:53:53 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EBB95B205A; Thu, 29 Mar 2018 01:56:02 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.178.48]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 9D0C2B2046; Thu, 29 Mar 2018 01:56:02 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id AF5D316C35AB; Wed, 28 Mar 2018 19:18:12 -0700 (PDT) Date: Wed, 28 Mar 2018 19:18:12 -0700 From: "Paul E. McKenney" To: Alan Stern Cc: schwidefsky@de.ibm.com, borntraeger@de.ibm.com, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, parri.andrea@gmail.com, will.deacon@arm.com, 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 Subject: Re: [PATCH RFC tools/memory-model] Add s390.{cfg,cat} Reply-To: paulmck@linux.vnet.ibm.com References: <20180328163344.GT3675@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18032904-0024-0000-0000-0000033D9E87 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008763; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000255; SDB=6.01009947; UDB=6.00514528; IPR=6.00789225; MB=3.00020304; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-29 04:54:14 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032904-0025-0000-0000-0000477AAE06 Message-Id: <20180329021812.GV3675@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-29_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803290054 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 28, 2018 at 02:04:07PM -0400, Alan Stern wrote: > 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. Ah, it does indeed get "Never" in that case, which I do not believe to e correct. > 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. The s390 fence instruction is "bcr 14,0" or "bcr 15,0", depending on how recent of hardware you are running. The latter works everywhere, if I recall correctly. But I do not believe that herd knows about either instruction yet. Ah, and I need to lose the "empty rmw & (fre;coe)". That appears to be where my spurious ordering was coming from, strange though that seems to me. And your use of "rf" instead of "rfe" makes sense, as that is what makes the read-from-write provide ordering, correct? And that should also cover the "Uniproc check" that would otherwise be required, right? Except that I get "Sometimes" on CoWR+poonceonce+Once.litmus... Which I can fix by unioning po-loc into po-ghb. Or is there some better way to do this? > This doesn't account for atomic operations properly; see the "implied" > term in x86tso.cat. I will look at this more later, reaching end of both battery and useful attention span... Thanx, Paul