public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Yu Zhang <yu.c.zhang@linux.intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: pbonzini@redhat.com, kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH] X86: Set up EPT before running vmx_pf_exception_test
Date: Thu, 4 Aug 2022 10:14:53 +0800	[thread overview]
Message-ID: <20220804021453.j5nptlscrso47p5w@linux.intel.com> (raw)
In-Reply-To: <YuqFS9nNVfMl6NnI@google.com>

On Wed, Aug 03, 2022 at 02:25:15PM +0000, Sean Christopherson wrote:
> On Wed, Aug 03, 2022, Yu Zhang wrote:
> > On Tue, Aug 02, 2022 at 08:41:47PM +0000, Sean Christopherson wrote:
> > > On Fri, Jul 15, 2022, Yu Zhang wrote:
> > > > Although currently vmx_pf_exception_test can succeed, its
> > > > success is actually because we are using identical mappings
> > > > in the page tables and EB.PF is not set by L1. In practice,
> > > > the #PFs shall be expected by L1, if it is using shadowing
> > > > for L2.
> > > 
> > > I'm a bit lost.  Is there an actual failure somewhere?  AFAICT, this passes when
> > > run as L1 or L2, with or without EPT enabled.
> > 
> > Thanks for your reply, Sean.
> > 
> > There's no failure. But IMHO, there should have been(for the
> > vmx_pf_exception_test, not the access test) -  L1 shall expect
> > #PF induced VM exits, when it is using shadow for L2.
> 
> Note, I'm assuming L1 == KVM-Unit-Tests, let me know if we're not using the same
> terminology.
> 
> Not using EPT / TDP doesn't strictly imply page table shadowing.  E.g. if a hypervisor
> provides a paravirt interface to install mappings, and the contract is that the VM
> must use the paravirt API, then the hypervisor doesn't need to intercept page faults
> because there are effectively no guest PTEs to write-protect / shadow.  
> 
> That's more or less what's happening here, L1 and L2 are collaborating to create
> page tables for L2, and so L1 doesn't need to intercept #PF.

Oh... So it is intentionally designed to let L1 and L2 use the same address space.
Then we can just drop this patch. Thanks a lot for the explanation!

B.R.
Yu

      reply	other threads:[~2022-08-04  2:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 11:33 [kvm-unit-tests PATCH] X86: Set up EPT before running vmx_pf_exception_test Yu Zhang
2022-08-02 20:41 ` Sean Christopherson
2022-08-03  1:57   ` Yu Zhang
2022-08-03 14:25     ` Sean Christopherson
2022-08-04  2:14       ` Yu Zhang [this message]

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=20220804021453.j5nptlscrso47p5w@linux.intel.com \
    --to=yu.c.zhang@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.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