]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
KVM: SVM: Fix FPU leak while emulating clts
authorAmit Shah <amit.shah@qumranet.com>
Sun, 2 Dec 2007 11:18:44 +0000 (13:18 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 Dec 2007 17:50:56 +0000 (09:50 -0800)
patch 404fb881b82cf0cf6981832f8d31a7484e4dee81 in mainline.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/kvm/kvm_main.c

index b514dfbb6758a4e8dfb95b57e838fd9c4c547ef9..504e81dcbf9000aa0e662e935dc519be4a3d9120 100644 (file)
@@ -1163,10 +1163,7 @@ int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address)
 
 int emulate_clts(struct kvm_vcpu *vcpu)
 {
-       unsigned long cr0;
-
-       cr0 = vcpu->cr0 & ~CR0_TS_MASK;
-       kvm_arch_ops->set_cr0(vcpu, cr0);
+       kvm_arch_ops->set_cr0(vcpu, vcpu->cr0 & ~X86_CR0_TS);
        return X86EMUL_CONTINUE;
 }