public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Subject: [PATCH 07/10] KVM: SVM: Fix FPU leak while emulating clts
Date: Sun,  2 Dec 2007 13:18:44 +0200	[thread overview]
Message-ID: <11965943273853-git-send-email-avi@qumranet.com> (raw)
In-Reply-To: <1196594327338-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

From: Amit Shah <amit.shah-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

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-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
---
 drivers/kvm/kvm_main.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

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;
 }
 
-- 
1.5.3


-------------------------------------------------------------------------
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

  parent reply	other threads:[~2007-12-02 11:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-02 11:18 [PATCH 00/10]: KVM updates for 2.6.23.9 (-stable) Avi Kivity
2007-12-02 11:18 ` [PATCH 01/10] KVM: x86 emulator: implement 'movnti mem, reg' Avi Kivity
2007-12-02 11:18 ` [PATCH 02/10] KVM: x86 emulator: fix access registers for instructions with ModR/M byte and Mod = 3 Avi Kivity
2007-12-02 11:18 ` [PATCH 03/10] KVM: x86 emulator: invd instruction Avi Kivity
2007-12-02 11:18 ` [PATCH 04/10] KVM: SVM: Intercept the 'invd' and 'wbinvd' instructions Avi Kivity
2007-12-02 11:18 ` [PATCH 05/10] KVM: x86 emulator: Use emulator_write_emulated and not emulator_write_std Avi Kivity
2007-12-02 11:18 ` [PATCH 08/10] KVM: Skip pio instruction when it is emulated, not executed Avi Kivity
     [not found] ` <1196594327338-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-02 11:18   ` [PATCH 06/10] KVM: Fix hang on uniprocessor Avi Kivity
2007-12-02 11:18   ` Avi Kivity [this message]
2007-12-02 11:18   ` [PATCH 09/10] KVM: VMX: Force vm86 mode if setting flags during real mode Avi Kivity
2007-12-02 11:18   ` [PATCH 10/10] KVM: VMX: Reset mmu context when entering " Avi Kivity
2007-12-02 19:08   ` [stable] [PATCH 00/10]: KVM updates for 2.6.23.9 (-stable) Greg KH
2007-12-03  9:23     ` [kvm-devel] " Avi Kivity
     [not found]       ` <4753CB07.7080807-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-03 12:57         ` Greg KH
     [not found]           ` <20071203125739.GA12233-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2007-12-03 13:11             ` Avi Kivity
     [not found]               ` <47540067.7090905-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-03 13:31                 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11965943273853-git-send-email-avi@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox