From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] KVM: x86 emulator: fix LMSW able to clear cr0.pe Date: Mon, 02 Aug 2010 09:48:12 +0200 Message-ID: <4C56783C.6060307@redhat.com> References: <1280720100-2449-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Marcelo Tosatti To: Avi Kivity Return-path: Received: from mail-bw0-f46.google.com ([209.85.214.46]:43189 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752857Ab0HBHsQ (ORCPT ); Mon, 2 Aug 2010 03:48:16 -0400 Received: by bwz1 with SMTP id 1so1306749bwz.19 for ; Mon, 02 Aug 2010 00:48:15 -0700 (PDT) In-Reply-To: <1280720100-2449-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 > --- > 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;