public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: x86 emulator: fix LMSW able to clear cr0.pe
@ 2010-08-02  3:35 Avi Kivity
  2010-08-02  7:48 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2010-08-02  3:35 UTC (permalink / raw)
  To: kvm, Marcelo Tosatti

LMSW is documented not to be able to set cr0.pe; make it so.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch/x86/kvm/emulate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index dc1ecff..05f80f7 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3212,7 +3212,7 @@ twobyte_insn:
 			c->dst.val = ops->get_cr(0, ctxt->vcpu);
 			break;
 		case 6: /* lmsw */
-			ops->set_cr(0, (ops->get_cr(0, ctxt->vcpu) & ~0x0ful) |
+			ops->set_cr(0, (ops->get_cr(0, ctxt->vcpu) & ~0x0eul) |
 				    (c->src.val & 0x0f), ctxt->vcpu);
 			c->dst.type = OP_NONE;
 			break;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] KVM: x86 emulator: fix LMSW able to clear cr0.pe
@ 2010-08-01 15:37 Avi Kivity
  0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2010-08-01 15:37 UTC (permalink / raw)
  To: Marcelo Tosatti, kvm

LMSW is documented not to be able to set cr0.pe; make it so.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch/x86/kvm/emulate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index dc1ecff..05f80f7 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3212,7 +3212,7 @@ twobyte_insn:
 			c->dst.val = ops->get_cr(0, ctxt->vcpu);
 			break;
 		case 6: /* lmsw */
-			ops->set_cr(0, (ops->get_cr(0, ctxt->vcpu) & ~0x0ful) |
+			ops->set_cr(0, (ops->get_cr(0, ctxt->vcpu) & ~0x0eul) |
 				    (c->src.val & 0x0f), ctxt->vcpu);
 			c->dst.type = OP_NONE;
 			break;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-02  7:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-02  3:35 [PATCH] KVM: x86 emulator: fix LMSW able to clear cr0.pe Avi Kivity
2010-08-02  7:48 ` Paolo Bonzini
2010-08-02  7:51   ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2010-08-01 15:37 Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox