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

2025-04-23 Thread Jürgen Groß
On 23.04.25 11:03, Xin Li wrote: On 4/22/2025 4:12 AM, Jürgen Groß wrote: + +static __always_inline bool __rdmsrq(u32 msr, u64 *val, int type) +{ +    bool ret; + +#ifdef CONFIG_XEN_PV +    if (cpu_feature_enabled(X86_FEATURE_XENPV)) +    return __xenpv_rdmsrq(msr, val, type); I don't thin

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

2025-04-23 Thread Xin Li
On 4/22/2025 4:12 AM, Jürgen Groß wrote: + +static __always_inline bool __rdmsrq(u32 msr, u64 *val, int type) +{ +    bool ret; + +#ifdef CONFIG_XEN_PV +    if (cpu_feature_enabled(X86_FEATURE_XENPV)) +    return __xenpv_rdmsrq(msr, val, type); I don't think this will work for the Xen PV ca

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

2025-04-22 Thread Jürgen Groß
On 22.04.25 10:22, Xin Li (Intel) wrote: To eliminate the indirect call overhead introduced by the pv_ops API, utilize the alternatives mechanism to read MSR: 1) When built with !CONFIG_XEN_PV, X86_FEATURE_XENPV becomes a disabled feature, preventing the Xen code from being built

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

2025-04-22 Thread Jürgen Groß
On 22.04.25 11:20, Xin Li wrote: On 4/22/2025 1:59 AM, Jürgen Groß wrote: On 22.04.25 10:22, Xin Li (Intel) wrote: To eliminate the indirect call overhead introduced by the pv_ops API, utilize the alternatives mechanism to read MSR: 1) When built with !CONFIG_XEN_PV, X86_FEATURE_XENPV bec

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

2025-04-22 Thread Xin Li
On 4/22/2025 1:59 AM, Jürgen Groß wrote: On 22.04.25 10:22, Xin Li (Intel) wrote: To eliminate the indirect call overhead introduced by the pv_ops API, utilize the alternatives mechanism to read MSR: 1) When built with !CONFIG_XEN_PV, X86_FEATURE_XENPV becomes a     disabled feature, p

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

2025-04-22 Thread Jürgen Groß
On 22.04.25 10:22, Xin Li (Intel) wrote: To eliminate the indirect call overhead introduced by the pv_ops API, utilize the alternatives mechanism to read MSR: 1) When built with !CONFIG_XEN_PV, X86_FEATURE_XENPV becomes a disabled feature, preventing the Xen code from being built

[RFC PATCH v2 22/34] x86/msr: Utilize the alternatives mechanism to read MSR

2025-04-22 Thread Xin Li (Intel)
To eliminate the indirect call overhead introduced by the pv_ops API, utilize the alternatives mechanism to read MSR: 1) When built with !CONFIG_XEN_PV, X86_FEATURE_XENPV becomes a disabled feature, preventing the Xen code from being built and ensuring the native code is executed