mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: David Laight <david.laight.linux@gmail.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@kernel.org>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH -tip 1/3] x86/fsgsbase: Remove unnecessary "memory" clobbers from FS/GS base accessors
Date: Tue, 10 Mar 2026 19:11:06 +0100	[thread overview]
Message-ID: <20260310181106.GG606826@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <CAFULd4Ym-x87r68pEAjyXUnRpUTHR0Mw7OYvfF3+H539DgWjJA@mail.gmail.com>

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.

  reply	other threads:[~2026-03-10 18:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10  8:21 Uros Bizjak
2026-03-10  8:21 ` [PATCH -tip 2/3] x86/segment: Remove unnecessary memory clobber from savesegment() Uros Bizjak
2026-03-10  8:21 ` [PATCH -tip 3/3] x86/segment: Use ASM_INPUT_RM in __loadsegment_fs() Uros Bizjak
2026-03-10 10:27 ` [PATCH -tip 1/3] x86/fsgsbase: Remove unnecessary "memory" clobbers from FS/GS base accessors Peter Zijlstra
2026-03-10 14:11   ` David Laight
2026-03-10 14:12     ` Peter Zijlstra
2026-03-10 15:48       ` Uros Bizjak
2026-03-10 18:11         ` Peter Zijlstra [this message]
2026-03-10 18:27           ` Uros Bizjak
2026-03-10 14:59     ` Uros Bizjak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260310181106.GG606826@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=david.laight.linux@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@kernel.org \
    --cc=ubizjak@gmail.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®