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 and ensuring the native code is executed unconditionally. 2) When built with CONFIG_XEN_PV: 2.1) If not running on the Xen hypervisor (!X86_FEATURE_XENPV), the kernel runtime binary is patched to unconditionally jump to the native MSR read code. 2.2) If running on the Xen hypervisor (X86_FEATURE_XENPV), the kernel runtime binary is patched to unconditionally jump to the Xen MSR read code. The alternatives mechanism is also used to choose the new immediate form MSR read instruction when it's available. Consequently, remove the pv_ops MSR read APIs and the Xen callbacks.
Same as the comment to patch 5: there is no indirect call overhead after the system has come up. Juergen
OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature