Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1271511ybl; Thu, 12 Dec 2019 12:24:12 -0800 (PST) X-Google-Smtp-Source: APXvYqz+bvq4mydAzTnN3o+SKeXxNTOC+Kfvu3mVFqIk9wGLR/9KVZj0Q9qg6INTPUMs8K9/DAPA X-Received: by 2002:a05:6830:2006:: with SMTP id e6mr9710737otp.367.1576182252681; Thu, 12 Dec 2019 12:24:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576182252; cv=none; d=google.com; s=arc-20160816; b=XhYI3nOEC/MJ+I/faMqDxKx1TlF0q7DVdOqS3p1qlnwLQgti4lj08EhOFTOpF/c/Qy 3TkAQ4aDHyrbSzI5qgjyREO4VQUX/5WsKEzEVTdYXpI/gK5GXvZ4Ih2z/+I/FUFme+aC yOzQzlY9F/7cH6etCizFsVx6CAdyYq3AuczMKB7q59FJ6hJpa132gBKMu4rjWCEA6Mke j4gcNC6Yf/lt5QS2PuRihErGghVy9pE1W4cXBbpLj7uCh/WGP+m25Wuid8nVNx76vnNW eaXWn92G3liE7m3D9GvwHtLq3GI1cTKXeHu64J8T1I0zGYdalYfx3YGduTNyyZr43wMQ /EJA== 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=oVn4n9KO0Wi7WPkaRPWf1qdzcetPOXcYdPlzDCBnbRo=; b=CHV5GqUM5x5NsKuFbsUcCz4RlSa5p12Bcf14L9UtTjdWcKmUbnrAnMf8g8uZthYNTg 2oCDuoz9I+T3NFtjwOgYSZMWnUg0QaM7JpH/k91Oi64Clxa7pv9hIZbxyeQg5DfyPjI9 AZotLPGXZwfF0I480vfeGksILIAIlXV+LtJ92VP45ZEk6UmmGlSK7PojXccKmOaZRHuI GEGgmdcvw/5H0S3Sf1zQmWI6V6W18bIiH45pQ+ISWb3tRefDj7XcU/7BCjfXgw+F6JIU CeK6sKN35LCj34oLE+ep4aFsaBadIOIi6csNwvrH0cfUFn45VV96IAKWbVFdnpnq7eIx tXBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dltFnCJk; 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 m24si3878334otn.67.2019.12.12.12.24.00; Thu, 12 Dec 2019 12:24:12 -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=bombadil.20170209 header.b=dltFnCJk; 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 S1730851AbfLLUWJ (ORCPT + 99 others); Thu, 12 Dec 2019 15:22:09 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:56626 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730707AbfLLUWJ (ORCPT ); Thu, 12 Dec 2019 15:22:09 -0500 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=oVn4n9KO0Wi7WPkaRPWf1qdzcetPOXcYdPlzDCBnbRo=; b=dltFnCJkTHTijV1oeQZ+c3MLr VTaCGN8lrrIBqNCfDrT/MfjGWJpbw2zWJrvGpiYseNzgjj/jQ8hsHHtt6OcvE2foPV2x1GFKXytPa a/uifxzN/siY79GEwrg+ikl40vaXBzW5eWV8xyXvIsR+6rPi7/0WuTJ0KpOnDGSQTTccPNbK9oGnT GVxomvni0k4qeMlOGLxp6UEK3Twx4VEo3uX1YDT1XgnByW0Mtr1F3vYoRqYg7LIt29bXDi+KydTsN kSPE7oYTY5GrhVFKlE1kLLFOKjQHG/duQsHF3hBtSdx7bmvIyU6Lz8C42dtRsVNdRnfTxjz9cNA7X aQKEA1mUA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifUyG-0006Ss-Ky; Thu, 12 Dec 2019 20:22:00 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id C9AF0980CCD; Thu, 12 Dec 2019 21:21:57 +0100 (CET) Date: Thu, 12 Dec 2019 21:21:57 +0100 From: Peter Zijlstra To: Will Deacon Cc: Linus Torvalds , Michael Ellerman , dja@axtens.net, Linux Kernel Mailing List , linuxppc-dev@lists.ozlabs.org, Christophe Leroy , linux-arch , Mark Rutland , Segher Boessenkool , Arnd Bergmann , Christian Borntraeger Subject: Re: READ_ONCE() + STACKPROTECTOR_STRONG == :/ (was Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.5-2 tag (topic/kasan-bitops)) Message-ID: <20191212202157.GD11457@worktop.programming.kicks-ass.net> References: <87blslei5o.fsf@mpe.ellerman.id.au> <20191206131650.GM2827@hirez.programming.kicks-ass.net> <875zimp0ay.fsf@mpe.ellerman.id.au> <20191212080105.GV2844@hirez.programming.kicks-ass.net> <20191212100756.GA11317@willie-the-truck> <20191212104610.GW2827@hirez.programming.kicks-ass.net> <20191212180634.GA19020@willie-the-truck> <20191212193401.GB19020@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191212193401.GB19020@willie-the-truck> 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 Thu, Dec 12, 2019 at 07:34:01PM +0000, Will Deacon wrote: > void ool_store_release(volatile unsigned long *ptr, unsigned long val) > { > smp_store_release(ptr, val); > } > > 0000000000000000 : > 0: a9be7bfd stp x29, x30, [sp, #-32]! > 4: 90000002 adrp x2, 0 <__stack_chk_guard> > 8: 91000042 add x2, x2, #0x0 > c: 910003fd mov x29, sp > 10: f9400043 ldr x3, [x2] > 14: f9000fa3 str x3, [x29, #24] > 18: d2800003 mov x3, #0x0 // #0 > 1c: c89ffc01 stlr x1, [x0] > 20: f9400fa1 ldr x1, [x29, #24] > 24: f9400040 ldr x0, [x2] > 28: ca000020 eor x0, x1, x0 > 2c: b5000060 cbnz x0, 38 > 30: a8c27bfd ldp x29, x30, [sp], #32 > 34: d65f03c0 ret > 38: 94000000 bl 0 <__stack_chk_fail> > > It's a mess, and fixing READ_ONCE() doesn't help this case, which is why > I was looking at getting rid of volatile where it's not strictly needed. > I'm certainly open to other suggestions, I just haven't managed to think > of anything else. We could move the kernel to C++ and write: std::remove_volatile::type __p = (p); /me runs like hell...