Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: SVM: Lazy fpu with npt

Now that we can allow the guest to play with cr0 when the fpu is loaded,
we can enable lazy fpu when npt is in use.

Acked-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>

authored by

Avi Kivity and committed by
Marcelo Tosatti
4610c83c d225157b

-8
-8
arch/x86/kvm/svm.c
··· 2588 2588 2589 2589 static void svm_prepare_guest_switch(struct kvm_vcpu *vcpu) 2590 2590 { 2591 - if (npt_enabled) 2592 - vcpu->fpu_active = 1; 2593 2591 } 2594 2592 2595 2593 static inline void sync_cr8_to_lapic(struct kvm_vcpu *vcpu) ··· 2925 2927 static void svm_fpu_deactivate(struct kvm_vcpu *vcpu) 2926 2928 { 2927 2929 struct vcpu_svm *svm = to_svm(vcpu); 2928 - 2929 - if (npt_enabled) { 2930 - /* hack: npt requires active fpu at this time */ 2931 - vcpu->fpu_active = 1; 2932 - return; 2933 - } 2934 2930 2935 2931 update_cr0_intercept(svm); 2936 2932 svm->vmcb->control.intercept_exceptions |= 1 << NM_VECTOR;