[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251016144730.GC3245006@noisy.programming.kicks-ass.net>
Date: Thu, 16 Oct 2025 16:47:30 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "Kaplan, David" <David.Kaplan@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...en8.de>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"x86@...nel.org" <x86@...nel.org>,
"H . Peter Anvin" <hpa@...or.com>, Alexander Graf <graf@...zon.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 40/56] x86/alternative: Use sync_core_nmi_safe()
On Thu, Oct 16, 2025 at 02:40:51PM +0000, Kaplan, David wrote:
> > Can we please keep this in sync_core()? Something like:
> >
> > static __always_inline void sync_core(void)
> > {
> > if (static_cpu_has(X86_FEATURE_SERIALIZE)) {
> > serialize();
> > return;
> > }
> >
> > + if (repatch_in_progress) {
> > + sync_core_nmi_safe();
> > + return;
> > + }
> > +
> > iret_to_self();
> > }
> >
> > That way all the modern stuff that has SERIALIZE will still use that.
>
> Hmm, I can't quite do that because sync_core() is used in a number of
> other places too (unless we make repatch_in_progress a true global).
We could just out-of-line the thing; nothing using this should care
about cycles -- all of this is quite expensive.
> I wonder though if it'd be ok to have sync_core() check
> IS_ENABLED(CONFIG_DYNAMIC_MITIGATIONS) and then always use the mov-cr2
> version? It might also have to check X86_FEATURE_XENPV and use IRET
> in that case but otherwise I'd think it's safe for machines that could
> support dynamic mitigations.
Yeah, dunno.. I'm not well versed in the virt thing.
BTW, will AMD do that SERIALIZE instruction?
Powered by blists - more mailing lists