All of lore.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

* Re: [PATCH] KVM: x86 emulator: fix LMSW able to clear cr0.pe
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2010-08-02  7:48 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, Marcelo Tosatti

On 08/02/2010 05:35 AM, Avi Kivity wrote:
> LMSW is documented not to be able to set cr0.pe; make it so.

The code is correct, but LMSW is documented not to be able to _clear_ 
cr0.pe. :)

Paolo

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


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

* Re: [PATCH] KVM: x86 emulator: fix LMSW able to clear cr0.pe
  2010-08-02  7:48 ` Paolo Bonzini
@ 2010-08-02  7:51   ` Avi Kivity
  0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2010-08-02  7:51 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kvm, Marcelo Tosatti

  On 08/02/2010 10:48 AM, Paolo Bonzini wrote:
> On 08/02/2010 05:35 AM, Avi Kivity wrote:
>> LMSW is documented not to be able to set cr0.pe; make it so.
>
> The code is correct, but LMSW is documented not to be able to _clear_ 
> cr0.pe. :)

Right, thinko.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.