From: Amit Shah Date: Mon, 19 Nov 2007 15:57:35 +0000 (+0200) Subject: KVM: SVM: Fix FPU leak while emulating clts X-Git-Tag: v2.6.24-rc4~86^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=404fb881b82cf0cf6981832f8d31a7484e4dee81;p=linux-2.6 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 Signed-off-by: Avi Kivity --- diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 07ae280e8f..47c10b8f89 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -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; }