Re: [PATCH v3 2/2] x86/vmx: optimize MSR_MISC_FEATURES_ENABLES switch

2019-03-25 Thread Sean Christopherson
On Mon, Mar 25, 2019 at 04:06:50PM +0800, Xiaoyao Li wrote: > KVM needs to switch MSR_MISC_FEATURES_ENABLES between host and guest in > every pcpu/vcpu context switch. Since WRMSR is expensive, this patch tries > to save cycles by avoiding WRMSR MSR_MISC_FEATURES_ENABLES whenever possible. > > If

[PATCH v3 2/2] x86/vmx: optimize MSR_MISC_FEATURES_ENABLES switch

2019-03-25 Thread Xiaoyao Li
KVM needs to switch MSR_MISC_FEATURES_ENABLES between host and guest in every pcpu/vcpu context switch. Since WRMSR is expensive, this patch tries to save cycles by avoiding WRMSR MSR_MISC_FEATURES_ENABLES whenever possible. If host's value is zero, nothing needs to be done, since guest can use