From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org, rkrcmar@redhat.com, jmattson@google.com
Subject: Re: [PATCH 2/5] KVM: nVMX: Skip VM-Exit Control vmentry checks that are necessary only if VMCS12 is dirty
Date: Wed, 10 Jul 2019 13:11:46 -0700 [thread overview]
Message-ID: <20190710201146.GG4348@linux.intel.com> (raw)
In-Reply-To: <9e0b1aba-8cf6-733c-dc4d-63aa61fcddd8@oracle.com>
On Wed, Jul 10, 2019 at 12:18:55PM -0700, Krish Sadhukhan wrote:
>
> On 7/10/19 7:28 AM, Paolo Bonzini wrote:
> >On 07/07/19 09:11, Krish Sadhukhan wrote:
> >> if (!vmx_control_verify(vmcs12->vm_exit_controls,
> >> vmx->nested.msrs.exit_ctls_low,
> >>- vmx->nested.msrs.exit_ctls_high) ||
> >>- nested_vmx_check_exit_msr_switch_controls(vcpu, vmcs12))
> >>+ vmx->nested.msrs.exit_ctls_high))
> >>+ return -EINVAL;
> >>+
> >Exit controls are not shadowed, are they?
>
> No, they aren't. However, I see that prepare_vmcs02_constant_state() which
> is called in the path of prepare_vmcs02_early_full() writes those Exit
> Control fields:
>
> vmcs_write32(VM_EXIT_MSR_STORE_COUNT, 0);
> vmcs_write64(VM_EXIT_MSR_LOAD_ADDR,
> __pa(vmx->msr_autoload.host.val));
> vmcs_write64(VM_ENTRY_MSR_LOAD_ADDR,
> __pa(vmx->msr_autoload.guest.val));
That's writing L0's values into vmcs02 when vmcs02 is first used. L1's
MSR load lists are processed purely in software, e.g. nested_vmx_load_msr().
The vmcs12 entries are consumed by KVM on every nested transition to
emulate the load/store functionality, but the validity of the *controls*
only needs to be checked when vmcs12 is dirty.
>
>
> Should we add these fields to the shadow list then ?
>
> >
> >Paolo
next prev parent reply other threads:[~2019-07-10 20:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-07 7:11 [PATCH 0/5] KVM: nVMX: Skip vmentry checks that are necessary only if VMCS12 is dirty Krish Sadhukhan
2019-07-07 7:11 ` [PATCH 1/5] KVM: nVMX: Skip VM-Execution Control " Krish Sadhukhan
2019-07-07 7:11 ` [PATCH 2/5] KVM: nVMX: Skip VM-Exit " Krish Sadhukhan
2019-07-10 14:28 ` Paolo Bonzini
2019-07-10 19:18 ` Krish Sadhukhan
2019-07-10 20:11 ` Sean Christopherson [this message]
2019-07-07 7:11 ` [PATCH 3/5] KVM: nVMX: Skip VM-Entry Control " Krish Sadhukhan
2019-07-10 16:28 ` Paolo Bonzini
2019-07-07 7:11 ` [PATCH 4/5] KVM: nVMX: Skip Host State Area vmentry " Krish Sadhukhan
2019-07-10 16:26 ` Paolo Bonzini
2019-07-07 7:11 ` [PATCH 5/5] KVM: nVMX: Skip Guest " Krish Sadhukhan
2019-07-10 16:33 ` Paolo Bonzini
2019-07-10 19:34 ` Krish Sadhukhan
2019-07-08 18:17 ` [PATCH 0/5] KVM: nVMX: Skip " Sean Christopherson
2019-07-09 22:50 ` Krish Sadhukhan
2019-07-10 14:35 ` Paolo Bonzini
2019-07-10 16:15 ` Sean Christopherson
2019-07-10 16:33 ` Paolo Bonzini
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=20190710201146.GG4348@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=jmattson@google.com \
--cc=krish.sadhukhan@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@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;
as well as URLs for NNTP newsgroup(s).