From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Aaron Lewis <aaronlewis@google.com>
Cc: pbonzini@redhat.com, rkrcmar@redhat.com, jmattson@google.com,
marcorr@google.com, kvm@vger.kernel.org,
Peter Shier <pshier@google.com>
Subject: Re: [PATCH 1/3] kvm: nVMX: Set nested_run_pending in vmx_set_nested_state after checks complete
Date: Fri, 3 May 2019 09:35:24 -0700 [thread overview]
Message-ID: <20190503163524.GB32628@linux.intel.com> (raw)
In-Reply-To: <20190502183125.257005-1-aaronlewis@google.com>
On Thu, May 02, 2019 at 11:31:25AM -0700, Aaron Lewis wrote:
> nested_run_pending=1 implies we have successfully entered guest mode.
> Move setting from external state in vmx_set_nested_state() until after
> all other checks are complete.
>
> Signed-off-by: Aaron Lewis <aaronlewis@google.com>
> Reviewed-by: Peter Shier <pshier@google.com>
> ---
> arch/x86/kvm/vmx/nested.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index 6401eb7ef19c..081dea6e211a 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -5460,9 +5460,6 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu,
> if (!(kvm_state->flags & KVM_STATE_NESTED_GUEST_MODE))
> return 0;
>
> - vmx->nested.nested_run_pending =
> - !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING);
@nested_run_pending is consumed by nested_vmx_enter_non_root_mode(),
e.g. prepare_vmcs02(). I'm guessing its current location is deliberate.
> -
> if (nested_cpu_has_shadow_vmcs(vmcs12) &&
> vmcs12->vmcs_link_pointer != -1ull) {
> struct vmcs12 *shadow_vmcs12 = get_shadow_vmcs12(vcpu);
> @@ -5489,6 +5486,9 @@ static int vmx_set_nested_state(struct kvm_vcpu *vcpu,
> if (ret)
> return -EINVAL;
>
> + vmx->nested.nested_run_pending =
> + !!(kvm_state->flags & KVM_STATE_NESTED_RUN_PENDING);
> +
> return 0;
> }
>
> --
> 2.21.0.593.g511ec345e18-goog
>
next prev parent reply other threads:[~2019-05-03 16:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-02 18:31 [PATCH 1/3] kvm: nVMX: Set nested_run_pending in vmx_set_nested_state after checks complete Aaron Lewis
2019-05-03 16:35 ` Sean Christopherson [this message]
2019-05-08 12:11 ` 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=20190503163524.GB32628@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=aaronlewis@google.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=marcorr@google.com \
--cc=pbonzini@redhat.com \
--cc=pshier@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.