]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: Make unloading of FPU state when putting vcpu arch-independent
authorAmit Shah <amit.shah@qumranet.com>
Thu, 15 Nov 2007 16:38:46 +0000 (18:38 +0200)
committerAvi Kivity <avi@qumranet.com>
Wed, 30 Jan 2008 15:53:05 +0000 (17:53 +0200)
Instead of having each architecture do it individually, we
do this in the arch-independent code (just x86 as of now).

[avi: add svm to the mix, which was added to mainline during the
 2.6.24-rc process]

Signed-off-by: Amit Shah <amit.shah@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/svm.c
drivers/kvm/vmx.c
drivers/kvm/x86.c

index 0d32304944fc78252fb9d9f5ab5d62cd9958f31b..fb3721d88dbff28e048f0c984f0918df0dd3f5eb 100644 (file)
@@ -659,7 +659,6 @@ static void svm_vcpu_put(struct kvm_vcpu *vcpu)
                wrmsrl(host_save_user_msrs[i], svm->host_user_msrs[i]);
 
        rdtscll(vcpu->host_tsc);
-       kvm_put_guest_fpu(vcpu);
 }
 
 static void svm_vcpu_decache(struct kvm_vcpu *vcpu)
index 7130f315afdf2b056b51c078eb956f1a6edc090c..0c082faaa6db813bd529892633f94dfdd7aae7db 100644 (file)
@@ -541,7 +541,6 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 static void vmx_vcpu_put(struct kvm_vcpu *vcpu)
 {
        vmx_load_host_state(to_vmx(vcpu));
-       kvm_put_guest_fpu(vcpu);
 }
 
 static void vmx_fpu_activate(struct kvm_vcpu *vcpu)
index fdc7632d762046034b1628ea57284ceee234ab1d..9618fcba887ee3a3d993fcfb27049d7a9fca8edb 100644 (file)
@@ -678,6 +678,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
 {
        kvm_x86_ops->vcpu_put(vcpu);
+       kvm_put_guest_fpu(vcpu);
 }
 
 static void cpuid_fix_nx_cap(struct kvm_vcpu *vcpu)