From: Andy Walls <awalls@md.metrocast.net>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: Don't allow lmsw to clear cr0.pe
Date: Tue, 11 May 2010 18:13:11 -0400 [thread overview]
Message-ID: <1273615991.4840.32.camel@localhost> (raw)
In-Reply-To: <1273613324-31910-1-git-send-email-avi@redhat.com>
On Wed, 2010-05-12 at 00:28 +0300, Avi Kivity wrote:
> The current lmsw implementation allows the guest to clear cr0.pe, contrary
> to the manual, which breaks EMM386.EXE.
>
> Fix by ORing the old cr0.pe with lmsw's operand.
>
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---
> arch/x86/kvm/x86.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index cd8a606..a40170c 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -462,7 +462,7 @@ EXPORT_SYMBOL_GPL(kvm_set_cr0);
>
> void kvm_lmsw(struct kvm_vcpu *vcpu, unsigned long msw)
> {
> - kvm_set_cr0(vcpu, kvm_read_cr0_bits(vcpu, ~0x0ful) | (msw & 0x0f));
> + kvm_set_cr0(vcpu, kvm_read_cr0_bits(vcpu, ~0x0eul) | (msw & 0x0f));
> }
> EXPORT_SYMBOL_GPL(kvm_lmsw);
>
Cool. I will build a kernel and test tomorrow.
Regards,
Andy
next prev parent reply other threads:[~2010-05-11 22:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-11 21:28 [PATCH] KVM: Don't allow lmsw to clear cr0.pe Avi Kivity
2010-05-11 22:13 ` Andy Walls [this message]
2010-05-12 16:18 ` Andy Walls
2010-05-13 3:31 ` Marcelo Tosatti
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=1273615991.4840.32.camel@localhost \
--to=awalls@md.metrocast.net \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/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 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.