repository: /home/avi/kvm/linux-2.6
branch: kvm-updates-2.6.23
commit d0200e4bdf627f0a84e0a6cf1a8985a6c4401f5e
Author: Amit Shah <[EMAIL PROTECTED]>
Date:   Mon Nov 19 17:57:35 2007 +0200

    KVM: SVM: Fix FPU leak while emulating clts
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index b514dfb..504e81d 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -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;
 }
 

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
kvm-commits mailing list
kvm-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-commits

Reply via email to