Re: [PATCH] x86/xen: Fix __xen_hypercall_setfunc

From: Ingo Molnar
Date: Fri Apr 11 2025 - 05:27:45 EST



* Juergen Gross <jgross@xxxxxxxx> wrote:

> On 10.04.25 21:31, Jason Andryuk wrote:
> > Hypercall detection is failing with xen_hypercall_intel() chosen even on
> > an AMD processor. Looking at the disassembly, the call to
> > xen_get_vendor() was removed.
> >
> > The check for boot_cpu_has(X86_FEATURE_CPUID) was used as a proxy for
> > the x86_vendor having been set. When
> > CONFIG_X86_REQUIRED_FEATURE_CPUID=y (the default value), DCE eliminates
> > the call to xen_get_vendor(). An uninitialized value 0 means
> > X86_VENDOR_INTEL, so the Intel function is always returned.
> >
> > Remove the if and always call xen_get_vendor() to avoid this issue.
> >
> > Fixes: 3d37d9396eb3 ("x86/cpufeatures: Add {REQUIRED,DISABLED} feature configs")
> > Suggested-by: Juergen Gross <jgross@xxxxxxxx>
> > Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
>
> Reviewed-by: Juergen Gross <jgross@xxxxxxxx>

Wanna merge this via the Xen tree, or should it go to x86/urgent?

The bug was *caused* by the x86 tree so we'd be glad to merge,
but your call.

If you'll merge it:

Acked-by: Ingo Molnar <mingo@xxxxxxxxxx>

Thanks,

Ingo