On Wed, Feb 07, 2024, Xin Li wrote:
Clear FRED VM entry/exit controls when initializing a vCPU, and set these controls only if FRED is enumerated after set CPUID.
FRED VM entry/exit controls need to be set to establish context sufficient to support FRED event delivery immediately after VM entry and exit. However it is not required to save/load FRED MSRs for a non-FRED guest, which aren't supposed to access FRED MSRs.
Does this actually provide a measurable performance boost? If not, just do the unnecessary load/store on entry/exit.
No performance measurement yet. Will make the change.
Generally speaking, the only time KVM dynamically toggles entry/exit controls is when KVM wants to run the guest with a host value, e.g. with the host's PERF_GLOBAL_CTRL.
Simple rule.
Thanks! Xin