From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Krish Sadhukhan <krish.sadhukhan@oracle.com>,
kvm@vger.kernel.org, rkrcmar@redhat.com, jmattson@google.com
Subject: Re: [PATCH 5/6 v5][KVM nVMX]: nested_vmx_check_vmentry_postreqs() should return VMX_EXIT_REASONS_FAILED_VMENTRY | EXIT_REASON_INVALID_STATE for error conditions
Date: Wed, 10 Apr 2019 10:55:30 -0700 [thread overview]
Message-ID: <20190410175530.GA27893@linux.intel.com> (raw)
In-Reply-To: <e115176c-d504-fa27-023b-c7e6cebffcc1@redhat.com>
On Wed, Apr 10, 2019 at 07:05:30PM +0200, Paolo Bonzini wrote:
> On 10/04/19 18:08, Sean Christopherson wrote:
> > Good point, though IMO it'd be better to go one step further and actually
> > consume the return value in nested_vmx_enter_non_root_mode(). For me,
> > having the exit reason in nested_vmx_check_vmentry_postreqs() is a nice
> > mental reminder that "postreqs" is referring to checks that happen once
> > the CPU has "committed" to VM-Enter.
>
> It's certainly better if you don't have to return
> VMX_EXIT_REASONS_FAILED_VMENTRY. However, I think it still complicates
> things a bit, after all the result is always EXIT_REASON_INVALID_STATE.
>
> The SDM says "VM-entry failure due to invalid guest state. A VM entry
> failed one of the checks identified in Section 26.3.1" so the bool (or
> 0/-EINVAL) return code is a nice reminder that the function covers a
> subset of 26.3.1.
Heh, for me, returning EXIT_REASON_INVALID_STATE is the reminder that
the function covers 26.3.1.
What if we rename the function to nested_vmx_check_vmentry_guest_state()?
My desire to return the exit reason mostly stems from the name "postreqs"
since I tend to forget what "postreqs" is referring to. And it'd be more
appropriate since the MSR load checks are handled elsewhere and really
should be considered "postreqs" as well.
next prev parent reply other threads:[~2019-04-10 17:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-08 21:35 [KVM nVMX]: Check "load IA32_PAT" VM-exit{entry} controls on vmentry of L2 guests (v5) Krish Sadhukhan
2019-04-08 21:35 ` [PATCH 1/6 v5][KVM nVMX]: Check "load IA32_PAT" VM-exit control on vmentry Krish Sadhukhan
2019-04-10 9:42 ` Paolo Bonzini
2019-04-08 21:35 ` [PATCH 2/6 v5][KVM nVMX]: Check "load IA32_PAT" VM-entry " Krish Sadhukhan
2019-04-08 21:35 ` [PATCH 3/6 v5][KVM nVMX]: Move the checks for Guest Control Registers and Guest MSRs to a separate function Krish Sadhukhan
2019-04-08 21:35 ` [PATCH 4/6 v5][KVM nVMX]: nested_check_guest_cregs_dregs_msrs() should return -EINVAL for error conditions Krish Sadhukhan
2019-04-09 16:20 ` Sean Christopherson
2019-04-08 21:35 ` [PATCH 5/6 v5][KVM nVMX]: nested_vmx_check_vmentry_postreqs() should return VMX_EXIT_REASONS_FAILED_VMENTRY | EXIT_REASON_INVALID_STATE " Krish Sadhukhan
2019-04-09 16:20 ` Sean Christopherson
2019-04-10 9:50 ` Paolo Bonzini
2019-04-10 16:08 ` Sean Christopherson
2019-04-10 17:05 ` Paolo Bonzini
2019-04-10 17:55 ` Sean Christopherson [this message]
2019-04-11 0:15 ` Krish Sadhukhan
2019-04-11 12:14 ` Paolo Bonzini
2019-04-11 16:29 ` Sean Christopherson
2019-04-11 18:15 ` Krish Sadhukhan
2019-04-08 21:35 ` [PATCH 6/6 v5][kvm-unit-test nVMX]: Check "load IA32_PAT" on vmentry of L2 guests Krish Sadhukhan
2019-04-10 12:03 ` Paolo Bonzini
2019-04-10 17:17 ` Sean Christopherson
2019-04-10 17:22 ` Paolo Bonzini
2019-04-10 17:34 ` 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=20190410175530.GA27893@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