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

Andrew Cooper
2025-10-23T19:26:04Z

> + /* + * For all other processors, there are quite a few ways to do
> this. + * IRET-to-self is nice because it works on every CPU, at any
> CPL + * (so it's compatible with paravirtualization), and it never
> exits + * to a hypervisor.

"Never" isn't correct.  "Typically doesn't" is better in this context.

On Intel, there's the NMI_WINDOW vmexit which generally occurs after the
IRET is complete.

On AMD, prior to current generation CPUs, there was no NMI virt support,
and intercepting IRET is how the hypervisor is forced to cope.  (The
intercept is Fault-like so happens before the IRET executes, and there
are a variety of increasingly terrible ways of trying to account for this.)

~Andrew