Skip to content

Commit

Permalink
KVM: SVM: Fix FPU leak while emulating clts
Browse files Browse the repository at this point in the history
The clts code didn't use set_cr0 properly, so our lazy FPU
processing wasn't being done by the clts instruction at all.

(this isn't called on Intel as the hardware does the decode for us)

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 Nov 27, 2007
1 parent 8d379a7 commit 404fb88
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,8 +1188,7 @@ int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address)

int emulate_clts(struct kvm_vcpu *vcpu)
{
vcpu->cr0 &= ~X86_CR0_TS;
kvm_x86_ops->set_cr0(vcpu, vcpu->cr0);
kvm_x86_ops->set_cr0(vcpu, vcpu->cr0 & ~X86_CR0_TS);
return X86EMUL_CONTINUE;
}

Expand Down

0 comments on commit 404fb88

Please sign in to comment.