Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1009837ybl; Wed, 21 Aug 2019 08:47:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwz5WZjTPaVywwCIBUUTJ1IXo47Yty9ExU3LUOFUhINS0RvQ3GDIl9IdYnAGM40Q7oYPBRx X-Received: by 2002:a65:4044:: with SMTP id h4mr29752997pgp.164.1566402422896; Wed, 21 Aug 2019 08:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566402422; cv=none; d=google.com; s=arc-20160816; b=bmnzKEeiqfbl6GWTs2Mj7Un/nPRvRcEjkKl3J+3/SL6avIaBI7ZU4IHcJaZKbeZ+2j QgtZP4Mb0xs6WSl6qjPrfz0auxAGCq8TsDhJkhqMEUAGpRcZ28Su2ZE/SiBxe+JApncq vb4TSuIs6/tiIaCDpFop1U/3aoQ9VkMpNgWmOxCkH2TjYV3dGFzgO+UGorGPNYRuUbJL o6gJ0JlbX494hj/wG1f/iz+9yB25LmmF5k8ua+7ZP50hw0L+YkRD01EiNQIouTgC3iyf A0Txpmad+PKVW5FMSMtQ93jlxkt/n5lYU7Ll3I8IT8L5E4WvoGI7ozQJ6KrBqqFbkh6Y 0qLA== 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=iNMFWtCVUyppqjH3IdnBVXbgFcyLHvc4XyezRJUSxvM=; b=IZ4LCsrjnL9+BQRE3R75WRx4/dcYB0p5k3ltETIzWIsG7Doq54sGW5Ax3aWqS1Xa5/ unzyyztLvfoSeggjcx52Ej4sSa1x7WYal2HIqSbMm/LR0hW1jcRwOFCh9J751FzJ76og 5Xwqz+SU9SmAPPpcncDho4yEfaDlLlg0EygNqFGxqguGSDIEvk+wUhlPKUAR2olo1ILs A/3Sg/9g/N2qit8ruiErokmgxHSMZImpF+M2n0szkHEQ4sxFuqkHtjvRVzoEZbWqiYMB 2IgB4VBjQ1sPDpKF0xOAz63yJAmQ1rVTsohU654HrTmuaRBG/EqLea1QK62601tF2OBf GlgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Ib9f3bRp; 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 h6si14427088pgc.202.2019.08.21.08.46.48; Wed, 21 Aug 2019 08:47:02 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Ib9f3bRp; 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 S1728677AbfHUPeC (ORCPT + 99 others); Wed, 21 Aug 2019 11:34:02 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37490 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726885AbfHUPeC (ORCPT ); Wed, 21 Aug 2019 11:34:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=iNMFWtCVUyppqjH3IdnBVXbgFcyLHvc4XyezRJUSxvM=; b=Ib9f3bRpltoNRpCH+woTeIbcP WSDU6AvMySyh08AJoaEp9TdoMNorEIVRwrO5lL0DuVFdFMXiJEWZIpZtbb+yH40vKc984XF03tDR2 KP3hunB1Nwkg38TWWg3kCGkkDgO/ppmczHxyl4Y6t0JVqW45CfqJcLnZTwO/QZP5XI1FAPX799s4u +O3Q8TVigoYhA0gSn6JJJv4/bEBjJoNT1fYZfgQt+PrsSMvjCiI3/3jOXixI2ENXZMvami4TBQHK7 UlYA0ZFtj9h1nBNFQQYgk4WCxeLcJJC0Yz0eUYZ4amOid8XMjqrk4WlPu2wI0Q4FvV3/cX3jPKxeu hzBdpRjtw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i0Sc4-0005hh-My; Wed, 21 Aug 2019 15:33:28 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B95E2305F65; Wed, 21 Aug 2019 17:32:53 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4CE5520A978FE; Wed, 21 Aug 2019 17:33:25 +0200 (CEST) Date: Wed, 21 Aug 2019 17:33:25 +0200 From: Peter Zijlstra To: "Paul E. McKenney" Cc: Will Deacon , Linus Torvalds , Mathieu Desnoyers , Thomas Gleixner , Joel Fernandes , Alan Stern , rostedt , Valentin Schneider , linux-kernel , Boqun Feng , Will Deacon , David Howells Subject: Re: [PATCH 1/1] Fix: trace sched switch start/stop racy updates Message-ID: <20190821153325.GD2349@hirez.programming.kicks-ass.net> References: <1642847744.23403.1566005809759.JavaMail.zimbra@efficios.com> <20190820135612.GS2332@hirez.programming.kicks-ass.net> <20190820202932.GW28441@linux.ibm.com> <20190821103200.kpufwtviqhpbuv2n@willie-the-truck> <20190821132310.GC28441@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190821132310.GC28441@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 Wed, Aug 21, 2019 at 06:23:10AM -0700, Paul E. McKenney wrote: > On Wed, Aug 21, 2019 at 11:32:01AM +0100, Will Deacon wrote: > > and so it is using a store-pair instruction to reduce the complexity in > > the immediate generation. Thus, the 64-bit store will only have 32-bit > > atomicity. In fact, this is scary because if I change bar to: > > > > void bar(u64 *x) > > { > > *(volatile u64 *)x = 0xabcdef10abcdef10; > > } > > > > then I get: > > > > bar: > > mov w1, 61200 > > movk w1, 0xabcd, lsl 16 > > str w1, [x0] > > str w1, [x0, 4] > > ret > > > > so I'm not sure that WRITE_ONCE would even help :/ > > Well, I can have the LWN article cite your email, then. So thank you > very much! > > Is generation of this code for a 64-bit volatile store considered a bug? > Or does ARMv8 exclude the possibility of 64-bit MMIO registers? And I > would guess that Thomas and Linus would ask a similar bugginess question > for normal stores. ;-) I'm calling this a compiler bug; the way I understand volatile this is very much against the intentended use case. That is, this is buggy even on UP vs signals or MMIO.