RE: [RFC PATCH 40/56] x86/alternative: Use sync_core_nmi_safe()

Kaplan, David
2025-10-16T18:56:45Z

[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Peter Zijlstra <peterz@infradead.org>
> Sent: Thursday, October 16, 2025 1:53 PM
> To: Kaplan, David <David.Kaplan@amd.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>; Borislav Petkov <bp@alien8.de>; Josh
> Poimboeuf <jpoimboe@kernel.org>; Pawan Gupta
> <pawan.kumar.gupta@linux.intel.com>; Ingo Molnar <mingo@redhat.com>; Dave
> Hansen <dave.hansen@linux.intel.com>; x86@kernel.org; H . Peter Anvin
> <hpa@zytor.com>; Alexander Graf <graf@amazon.com>; Boris Ostrovsky
> <boris.ostrovsky@oracle.com>; linux-kernel@vger.kernel.org
> Subject: Re: [RFC PATCH 40/56] x86/alternative: Use sync_core_nmi_safe()
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Thu, Oct 16, 2025 at 03:34:14PM +0000, Kaplan, David wrote:
>
> > I will note that on AMD, MFENCE has the required serializing
> > properties (like SERIALIZE). On AMD, we could use MFENCE in
> > sync_core() which is probably faster that iret_to_self(). But
> > again...do we really care.
>
> About faster, no. But MFENCE has the benefit of not causing VMEXITs and
> also not being IRET, so I'm not opposed to you using that as an AMD
> version of SERIALIZE for the time being.

Ok. Btw, how long has Intel supported SERIALIZE?

Do we even need a 'mov-cr2' version of sync_core or could we say that dynamic mitigations requires a CPU capable of either a serializing MFENCE or SERIALIZE.

--David Kaplan