public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Hillf Danton <dhillf@gmail.com>
Cc: Ben-Ami Yassour <benami@il.ibm.com>,
	kvm@vger.kernel.org, Yaniv Kamay <ykamay@redhat.com>,
	Amit Shah <amit.shah@redhat.com>
Subject: Re: [PATCH] KVM: x86: fixup kvm_set_cr4()
Date: Wed, 08 Sep 2010 13:01:09 +0300	[thread overview]
Message-ID: <4C875EE5.8060004@redhat.com> (raw)
In-Reply-To: <AANLkTi=8i166xjdabWF2eArPnZRLWUbypD1Q=46EtYe+@mail.gmail.com>

  On 09/04/2010 03:43 PM, Hillf Danton wrote:


Subject lines such as "fixup $x" are too general.  Try to make them more 
specific.

> X86_CR4_VMXE is checked earlier, since
> [1] virtualization is not allowed in guest,

Why does that matter?  Note it may change one day.

> [2] load_pdptrs() could be saved.

The common case is that the mov does not fault and we have to call 
load_pdptrs() anyway.

It's a little cleaner to check before doing anything, though.

>
> Signed-off-by: Hillf Danton <dhillf@gmail.com <mailto:dhillf@gmail.com>>
> ---
>
> --- o/linux-2.6.36-rc1/arch/x86/kvm/x86.c 2010-08-16 
> 08:41:38.000000000 +0800
> +++ m/linux-2.6.36-rc1/arch/x86/kvm/x86.c 2010-09-04 
> 20:25:04.000000000 +0800
> @@ -539,6 +539,9 @@ int kvm_set_cr4(struct kvm_vcpu *vcpu, u
> if (cr4 & CR4_RESERVED_BITS)
> return 1;
> + if (cr4 & X86_CR4_VMXE)
> + return 1;
> +
> if (!guest_cpuid_has_xsave(vcpu) && (cr4 & X86_CR4_OSXSAVE))
> return 1;
> @@ -550,9 +553,6 @@ int kvm_set_cr4(struct kvm_vcpu *vcpu, u
> && !load_pdptrs(vcpu, vcpu->arch.cr3))
> return 1;
> - if (cr4 & X86_CR4_VMXE)
> - return 1;
> -
> kvm_x86_ops->set_cr4(vcpu, cr4);
> if ((cr4 ^ old_cr4) & pdptr_bits)
>


-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


           reply	other threads:[~2010-09-08 10:01 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <AANLkTi=8i166xjdabWF2eArPnZRLWUbypD1Q=46EtYe+@mail.gmail.com>]

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=4C875EE5.8060004@redhat.com \
    --to=avi@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=benami@il.ibm.com \
    --cc=dhillf@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=ykamay@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox