Re: [RFC PATCH v2 21/34] x86/msr: Utilize the alternatives mechanism to write MSR

Peter Zijlstra
2025-04-25T07:12:13Z

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

On Tue, Apr 22, 2025 at 11:57:01AM +0200, Jürgen Groß wrote:
> On 22.04.25 10:22, Xin Li (Intel) wrote:

> > This becomes even more silly for trivial instructions like STI/CLI
> > or in the worst case paravirt_nop().
>
> This is nonsense.

What Jurgen says. Someone hasn't done their homework.

static __always_inline void arch_local_irq_disable(void)
{
PVOP_ALT_VCALLEE0(irq.irq_disable, "cli;", ALT_NOT_XEN);
}

static __always_inline void arch_local_irq_enable(void)
{
PVOP_ALT_VCALLEE0(irq.irq_enable, "sti;", ALT_NOT_XEN);
}

That very much patches in STI/CLI directly when not Xen.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]