Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp692854img; Tue, 26 Feb 2019 07:06:24 -0800 (PST) X-Google-Smtp-Source: AHgI3IbTgfMLg+fJmyS2FNmbCwltv2G9Rs8mdV15A9KM++thFbH/7ySxlhIaD4UPy1wk7sBIl1hK X-Received: by 2002:a63:4509:: with SMTP id s9mr24613404pga.420.1551193584739; Tue, 26 Feb 2019 07:06:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551193584; cv=none; d=google.com; s=arc-20160816; b=yidljl5tqFKVyXXkvfZV8rRBebzOzQZ2MVEe8JW/YcW0HvwSo1mk9vu5OOV4nJXFEE entid5RmxwkFO9uyuVj4OynWG3ccNQdpuyBDnUSoVJkNCpRMTM2/7fP6L4DIxnhYUGoh znzuUbvlr18etCpDs1pGwnyd0QnpSYSOrKTOB3Czsib6dGp6vBYeQkLIhp3Oh/a3WzDv r3oGuWzoCV6HApAzR+w0LOdmknndvWXx8/gPWBqXNd7rY1chCucLrxOPJChAwyyBgI26 xD/IiOutpLldw/B+38m4o8xutZcw0zP8ha3+d1CBWR0Al6Z06Aj88pxqo3HCIoYBxvkJ CQAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=sSgYUbHEsqo5tOsVPRM5JrDWmdpu/hrT7g9SHCyevzU=; b=wI1f1LSnKyw+s75s+irMmCWmm19TDUHS5MSODUSDA9E9TO5Zp9jMmQGqSMxCidfnDv 9JeOjEHPBDUfbSsKvdWf7Fa6Nwp522V8rYqt9QVjDknZgyZSkZs+x1VrA2YXqvHvVAqR 6nTggJ3d29uNGe/ANuGgUPX5wtrNPNaWoHqovTUL9t2LqEnqyi6Pa4aQLo+heMOufut0 IiFObVJa+nojaeSUIpC5IvJEHmK23bct1oH27EAhIMj+nw/BjoVxOOhguDfKkA1HAF9Z 6Lsw0PACaweg91KHFUY3CTLMugkYLCcgKCtrHNkHh16LYfwCfAx00bZUzchPhuxI67JR qs+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=nUZjqjWO; 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 j7si12362126pll.121.2019.02.26.07.06.08; Tue, 26 Feb 2019 07:06:24 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=nUZjqjWO; 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 S1728088AbfBZPFL (ORCPT + 99 others); Tue, 26 Feb 2019 10:05:11 -0500 Received: from merlin.infradead.org ([205.233.59.134]:53506 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbfBZPFL (ORCPT ); Tue, 26 Feb 2019 10:05:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=sSgYUbHEsqo5tOsVPRM5JrDWmdpu/hrT7g9SHCyevzU=; b=nUZjqjWOp94putRtFVoj0x0BF IvZ3SQ9K5Y7Znri4HKnAW4RcinBs2hW3WsxeqobYiEifMKtP+R23reIVA5iLF9kJQPdda9k1b+8yx 5MFblu2j9bTQ6POBg7O9QUB8ZmlVJDa1GYy3E/iWKHK7AyjS7c/fOhn6k53QM3Klkqy40Phqx3GW9 zMWUPYFadQSi5gp1lhpclb3sBcVWxA0m/6QbC2oixhfy/BSRbTu1fBccA1UhzmVMWJddCc56oEXvF 7Gr3czTeGanJtOtcPsoilAVjJHJ8gaLy2SUzSObSCfQ5JBi5S2PQc4pT493lvUvNsD0cCG/8wh3Ar pracpCM+A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gyeHt-0006eS-Dl; Tue, 26 Feb 2019 15:04:53 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C69D620269AFD; Tue, 26 Feb 2019 16:04:50 +0100 (CET) Date: Tue, 26 Feb 2019 16:04:50 +0100 From: Peter Zijlstra To: "Paul E. McKenney" Cc: Borislav Petkov , Andrea Parri , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Alan Stern , Will Deacon , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Daniel Lustig Subject: Re: [RFC PATCH] tools/memory-model: Remove (dep ; rfi) from ppo Message-ID: <20190226150450.GW32477@hirez.programming.kicks-ass.net> References: <20190222130014.GY32494@hirez.programming.kicks-ass.net> <20190225175517.GK4072@linux.ibm.com> <20190226093009.GS32477@hirez.programming.kicks-ass.net> <20190226104551.GF32534@hirez.programming.kicks-ass.net> <20190226112133.GG32534@hirez.programming.kicks-ass.net> <20190226112521.GH32534@hirez.programming.kicks-ass.net> <20190226113008.GI32534@hirez.programming.kicks-ass.net> <20190226113813.GA14753@zn.tnic> <20190226134906.GG32494@hirez.programming.kicks-ass.net> <20190226142845.GK4072@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190226142845.GK4072@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 26, 2019 at 06:28:45AM -0800, Paul E. McKenney wrote: > Yes, this all is a bit on the insane side from a kernel viewpoint. > But the paper you found does not impose this; it has instead been there > for about 20 years, back before C and C++ admitted to the existence > of concurrency. But of course compilers are getting more aggressive, > and yes, some of the problems show up in single-threaded code. But that paper is from last year!! It has Peter Sewell on, I'm sure he's heard of concurrency. > The usual response is "then cast the pointers to intptr_t!" but of > course that breaks type checking. I tried laundering the pointer through intptr_t, but I can't seem to unbreak it. root@ivb-ep:~/tmp# gcc-8 -O2 -fno-strict-aliasing -o ptr ptr.c ; ./ptr p=0x55aacdc80034 q=0x55aacdc80034 x=1 y=2 *p=11 *q=2 root@ivb-ep:~/tmp# cat ptr.c #include #include #include int y = 2, x = 1; int main (int argc, char **argv) { intptr_t P = (intptr_t)&x; intptr_t Q = (intptr_t)&y; P += sizeof(int); int *q = &y; printf("p=%p q=%p\n", (int*)P, (int*)Q); if (P == Q) { int *p = (int *)P; *p = 11; printf("x=%d y=%d *p=%d *q=%d\n", x, y, *p, *q); } }