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 91BD03D647E for ; Tue, 10 Mar 2026 18:11:11 +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=1773166276; cv=none; b=nJezqY13q6kNHovJzLlvoalsdNskhnsjmcud+Lz+Cl5+8XT/ndSwFEbt5CwA5dKpgfzQgsCM69j7sddXjAijbKSiM5fwG9BzjMCLYhFq7NmX04pSnLcl0wemAPVzKlsj47M5nWoLSz2xs/JpruTw2xRvE9vPAOj1apgAN+Mv8EU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773166276; c=relaxed/simple; bh=EhVCcf3iej3KMuVNj9t4Jy8iuErjg+PMuEg2I6isacc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PUUC9OiKcSQ7IwYeYtCjuJ/jbnrra8On/a0dludy1tvNh8BKmhiasjypxaWpGs1KUzIlVDG6U2HKjLgWA5AkHLH2+X2IAGQky/0U2V00py1Kui80B3cQuFQKUI5gSjQC4rmqRgRMRwMI8Pn6sncl0gEBtfiMK8/M8+nkXNNBJVE= 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=mTprCo4a; 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="mTprCo4a" 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=W9CjWSIE9Bkzpqnzj57VjkH5/jD3a+5I3xaavCPRxN8=; b=mTprCo4aQvTNUnb+yQ4ikH++in CSSTYaWhNu/h7XTXBXpO4l64cG7I09s8sN+M8YyvNdPh9hzeGEn83k2nPTIezAXlCau84Fc66yxmS gZkkIr/CJBvX/1F822lnHcOS/tQ04lq6SmYF+qCJD9BDptw7PVca0qyJ0m/9nJlZE5pXgNj66oL0J d2o7a0Fi60Cz+6Xh6ObKd9joQaMcD61znqKdgOk03wRP7cFju4vDi65gUoWZidhTB3ZF67eJt8rmb VV3Zwl0dtSR/KT5px27H8zkbplYer71V6c6uSMRrQIZ7tSUoYA8aYoT57v0QcsVxwKusSmBtGXfzJ 4QrtVfEw==; 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 1w01Xw-00000008J6s-14cp; Tue, 10 Mar 2026 18:11:08 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id D9FDA300462; Tue, 10 Mar 2026 19:11:06 +0100 (CET) Date: Tue, 10 Mar 2026 19:11:06 +0100 From: Peter Zijlstra To: Uros Bizjak Cc: David Laight , x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: Re: [PATCH -tip 1/3] x86/fsgsbase: Remove unnecessary "memory" clobbers from FS/GS base accessors Message-ID: <20260310181106.GG606826@noisy.programming.kicks-ass.net> References: <20260310082142.93834-1-ubizjak@gmail.com> <20260310102742.GU1282955@noisy.programming.kicks-ass.net> <20260310141104.4c57ea79@pumpkin> <20260310141255.GW1282955@noisy.programming.kicks-ass.net> 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: On Tue, Mar 10, 2026 at 04:48:34PM +0100, Uros Bizjak wrote: > On 3/10/26 11:27, Peter Zijlstra wrote: > > On Tue, Mar 10, 2026 at 09:21:22AM +0100, Uros Bizjak wrote: > > >> The rdfsbase() and rdgsbase() helpers currently include a "memory" clobber > >> in their inline assembly definitions. However, the RDFSBASE and RDGSBASE > >> instructions only read the FS/GS base MSRs into a general-purpose register > >> and do not access memory. As such, the "memory" clobber is unnecessary. > > > > The point isn't that this accesses memory, but that prior or later > > accesses would end up at different memory locations (as would happen > > when setting the per-cpu segment. > > Please note that the above comment is talking about rd[fs,gs]base > instructions that only *read* the segment register into GPR. They do > not affect memory in any way and can be scheduled anywhere, but they > should not be scheduled over segment register *setting* instructions. Yes, we are in violent agreement :-) I just took issue with the way your changelog expressed things. The memory clobber isn't about the asm accessing memory or not, it is about adding a scheduling constraint. > > Anyway, aside from that nit, yes these 3 patches look good to me. > > Can this be considered as Acked-by: from your side? Yep.