From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Jim Mattson <jmattson@google.com>
Cc: Peter Shier <pshier@google.com>, kvm list <kvm@vger.kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] KVM: nVMX: Update VMCS02 when L2 PAE PDPTE updates detected
Date: Tue, 18 Aug 2020 10:24:29 -0700 [thread overview]
Message-ID: <20200818172429.GG15390@linux.intel.com> (raw)
In-Reply-To: <CALMp9eS5UOPGF0v2vt9aMPEZT7_a6ruJx9n_DLKkjiEb_kCWag@mail.gmail.com>
On Tue, Aug 18, 2020 at 10:14:39AM -0700, Jim Mattson wrote:
> On Tue, Aug 18, 2020 at 8:20 AM Sean Christopherson
> <sean.j.christopherson@intel.com> wrote:
>
> > I'd prefer to handle this on the switch from L2->L1. It avoids adding a
> > kvm_x86_ops and yet another sequence of four VMWRITEs, e.g. I think this
> > will do the trick.
> >
> > diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> > index 9c74a732b08d..67465f0ca1b9 100644
> > --- a/arch/x86/kvm/vmx/nested.c
> > +++ b/arch/x86/kvm/vmx/nested.c
> > @@ -4356,6 +4356,9 @@ void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 vm_exit_reason,
> > if (kvm_check_request(KVM_REQ_TLB_FLUSH_CURRENT, vcpu))
> > kvm_vcpu_flush_tlb_current(vcpu);
> >
> > + if (enable_ept && is_pae_paging(vcpu))
> > + ept_load_pdptrs(vcpu);
> > +
>
> Are the mmu->pdptrs[] guaranteed to be valid at this point? If L2 has
> PAE paging enabled, and it has modified CR3 without a VM-exit, where
> are the current PDPTE values read from the vmcs02 into mmu->pdptrs[]?
ept_load_pdptrs() checks kvm_register_is_dirty(vcpu, VCPU_EXREG_PDPTR). The
idea is basically the same as the above TLB_FLUSH_CURRENT; process pending
requests and/or dirty state for L2 before switching to L1.
next prev parent reply other threads:[~2020-08-18 17:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 0:43 [PATCH] KVM: nVMX: Update VMCS02 when L2 PAE PDPTE updates detected Peter Shier
2020-08-18 15:20 ` Sean Christopherson
2020-08-18 17:14 ` Jim Mattson
2020-08-18 17:24 ` Sean Christopherson [this message]
2020-08-18 17:34 ` Jim Mattson
2020-08-18 17:45 ` Sean Christopherson
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=20200818172429.GG15390@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=pshier@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;
as well as URLs for NNTP newsgroup(s).