From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1ED9D32573F for ; Fri, 20 Mar 2026 09:11:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773997908; cv=none; b=T0g+9b+Sr4wlpRCZmpkMHd68YM5UTSUPTwk16pdw5/w3NWYiJ0MX68gQu/uqk1vKGirp1FPQSGIyPnXcEUz46S+9+7hroUk6cEuQGg0AIzyrk/KeQSNj+e94uSBbZOZFqfSAFhF4pZmFoDkNR4/wyqnOjBIVqXFoQMc73cdnbK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773997908; c=relaxed/simple; bh=D2FYLTxZ9pG1G/k7QzGKVwVpExIWbFkhqQOQORSRuDo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZTNE+fB/CahZYVnLb3l/4ZB4gmeztGCrfB3gGSA6G6nUzlXU71XVihQp3OEMxOfh/BvXhMragdEuDxnj4R2FAgvKZeQPDlt6i+07gosfJruBx8kJ55x4Tam8hZeLA79oTWbJXEZltL5WIOq4rklI3t7z+pbxqmCOienQsBgFKPc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=dIq2cGoU; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="dIq2cGoU" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=2/ejTsjIbrplE+ZJRmTzniimKojDB0foKMVsdhcds/I=; b=dIq2cGoU16DXHOpW2JSXTVLZSU psGZuPPOV4OfWYhtFSsPS65SljE9LpaQz843TqXttAxsYMEtKYEQRgxksu2p4RKsJrnWfy40Ob8Hv MCsZCmCAVPWMoe4HGMJm3vwDao+kGJz55F2/7meKdE6kusxgx3EjIlxbwpM6GtvldD0d8pU2ICtfS lMHogGo/1yUgv3PYcPTwYaC334JUj8vsJXjRRPPzjYpgH9a2d5oKHCS3/3azrZItkCR56bIA8ZHZw f/e6EwwLNkrkET5ujehEEemqq/EmuMQoNpFpTCT/RDv5ygg09KDU3SPtO7RFuxCfVxY3hQOuAxjR9 hMnZuC9Q==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1w3VtI-00000007Wtx-2eSG; Fri, 20 Mar 2026 09:11:36 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id EC3C4301150; Fri, 20 Mar 2026 10:11:34 +0100 (CET) Date: Fri, 20 Mar 2026 10:11:34 +0100 From: Peter Zijlstra To: Thomas Gleixner Cc: LKML , Mathieu Desnoyers , =?iso-8859-1?Q?Andr=E9?= Almeida , Sebastian Andrzej Siewior , Carlos O'Donell , Florian Weimer , Rich Felker , Torvald Riegel , Darren Hart , Ingo Molnar , Davidlohr Bueso , Arnd Bergmann , "Liam R . Howlett" , Uros Bizjak , Thomas =?iso-8859-1?Q?Wei=DFschuh?= Subject: Re: [patch v2 04/11] uaccess: Provide unsafe_atomic_store_release_user() Message-ID: <20260320091134.GP3738786@noisy.programming.kicks-ass.net> References: <20260319225224.853416463@kernel.org> <20260319231239.410326941@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260319231239.410326941@kernel.org> On Fri, Mar 20, 2026 at 12:24:25AM +0100, Thomas Gleixner wrote: > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -403,6 +403,10 @@ config ARCH_32BIT_OFF_T > config ARCH_32BIT_USTAT_F_TINODE > bool > > +# Selected by architectures when plain stores have release semantics > +config ARCH_STORE_IMPLIES_RELEASE > + bool > + > config HAVE_ASM_MODVERSIONS > bool > help > --- a/include/linux/uaccess.h > +++ b/include/linux/uaccess.h > @@ -644,6 +644,15 @@ static inline void user_access_restore(u > #define user_read_access_end user_access_end > #endif > > +#ifndef unsafe_atomic_store_release_user > +# define unsafe_atomic_store_release_user(val, uptr, elbl) \ > + do { \ > + if (!IS_ENABLED(CONFIG_ARCH_STORE_IMPLIES_RELEASE)) \ > + smp_mb(); \ > + unsafe_put_user(val, uptr, elbl); \ > + } while (0) > +#endif > + > /* Define RW variant so the below _mode macro expansion works */ > #define masked_user_rw_access_begin(u) masked_user_access_begin(u) > #define user_rw_access_begin(u, s) user_access_begin(u, s) Looking at this again after a sleep; does it make sense to rename this config symbol to something like ARCH_MEMORY_ORDER_TSO or somesuch? I mean, this is only going to be the 3 TSO architectures (x86, s390 and sparc64) setting this anyway, might as well make a little more generic config symbol for this. OTOH, its easy enough to rename the config thing if it ever is needed elsewhere I suppose.