public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@kernel.org>
To: Dennis Chen <kernel.org.gnu@gmail.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	pbonzini@redhat.com, "wanpeng.li" <wanpeng.li@linux.intel.com>
Subject: Re: [PATCH] KVM-Use value reading from MSR when construct the eptp in VMX mode
Date: Mon, 25 Aug 2014 17:04:07 +0300	[thread overview]
Message-ID: <20140825140407.GH18167@minantech.com> (raw)
In-Reply-To: <CA+U0gVg13bF_OwRbbH-ZW2Rb9TbYixwgF9m_Utt_cGWb_iH+qQ@mail.gmail.com>

On Mon, Aug 25, 2014 at 11:16:34AM +0800, Dennis Chen wrote:
> On Sun, Aug 24, 2014 at 5:38 PM, Gleb Natapov <gleb@kernel.org> wrote:
> > On Sun, Aug 24, 2014 at 11:54:32AM +0800, Dennis Chen wrote:
> >> This patch is used to construct the eptp in vmx mode with values
> >> readed from MSR according to the intel x86 software developer's
> >> manual.
> >>
> >>  static u64 construct_eptp(unsigned long root_hpa)
> >>  {
> >> -    u64 eptp;
> >> +    u64 eptp, pwl;
> >> +
> >> +    if (cpu_has_vmx_ept_4levels())
> >> +        pwl = VMX_EPT_DEFAULT_GAW << VMX_EPT_GAW_EPTP_SHIFT;
> >> +    else {
> >> +        WARN(1, "Unsupported page-walk length of 4.\n");
> > Page-walk length of 4 is the only one that is supported.
> >
> Since there is a bit 6 in IA32_VMX_EPT_VPID_CAP MSR indicating the
> support for the page-walk length, I think sanity check is necessary.
> But I just checked the code, it's already done in the hardware_setup()
> function which will disable ept feature if the page-wake length is not
> 4. Gleb, any comments for the memory type check part?
Looks fine, but are there CPUs out there that do not support WB for eptp? Since
there was no bug reports about it I assume no.

--
			Gleb.

  reply	other threads:[~2014-08-25 14:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+U0gVjxF+o3xHPULUQ26wJs4myW3gxUODnUJ3xaYVT6-mFYdg@mail.gmail.com>
2014-08-24 23:14 ` [PATCH] KVM-Use value reading from MSR when construct the eptp in VMX mode Wanpeng Li
2014-08-25  3:21   ` Dennis Chen
     [not found] ` <20140824093759.GG18167@minantech.com>
2014-08-25  3:16   ` Dennis Chen
2014-08-25 14:04     ` Gleb Natapov [this message]
2014-08-26  2:34       ` Dennis Chen

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=20140825140407.GH18167@minantech.com \
    --to=gleb@kernel.org \
    --cc=kernel.org.gnu@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=wanpeng.li@linux.intel.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