Skip to content

Commit

Permalink
KVM: Make unloading of FPU state when putting vcpu arch-independent
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amit Shah authored and Avi Kivity committed Jan 30, 2008
1 parent 4cee576 commit 9327fd1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion drivers/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions drivers/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9327fd1

Please sign in to comment.