From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Dan Cross <dcross@google.com>, Peter Shier <pshier@google.com>
Subject: Re: [PATCH v2 3/7] KVM: nVMX: Explicitly check for valid guest state for !unrestricted guest
Date: Fri, 25 Sep 2020 23:33:23 +0200 [thread overview]
Message-ID: <0fc761eb-8758-ae96-65b1-90cc4d32f043@redhat.com> (raw)
In-Reply-To: <20200923184452.980-4-sean.j.christopherson@intel.com>
On 23/09/20 20:44, Sean Christopherson wrote:
> +bool __vmx_guest_state_valid(struct kvm_vcpu *vcpu)
> {
> - if (enable_unrestricted_guest)
> - return true;
> -
> /* real mode guest state checks */
> if (!is_protmode(vcpu) || (vmx_get_rflags(vcpu) & X86_EFLAGS_VM)) {
> if (!rmode_segment_valid(vcpu, VCPU_SREG_CS))
> diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h
> index d7ec66db5eb8..e147f180350f 100644
> --- a/arch/x86/kvm/vmx/vmx.h
> +++ b/arch/x86/kvm/vmx/vmx.h
> @@ -343,6 +343,15 @@ void vmx_get_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg);
> void vmx_set_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg);
> u64 construct_eptp(struct kvm_vcpu *vcpu, unsigned long root_hpa,
> int root_level);
> +
> +bool __vmx_guest_state_valid(struct kvm_vcpu *vcpu);
> +static inline bool vmx_guest_state_valid(struct kvm_vcpu *vcpu)
> +{
> + if (enable_unrestricted_guest)
> + return true;
> +
> + return __vmx_guest_state_valid(vcpu);
This is now "if (is_unrestricted_guest (vcpu))", but the patch otherwise
applies.
Paolo
next prev parent reply other threads:[~2020-09-25 21:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 18:44 [PATCH v2 0/7] KVM: nVMX: Bug fixes and cleanup Sean Christopherson
2020-09-23 18:44 ` [PATCH v2 1/7] KVM: nVMX: Reset the segment cache when stuffing guest segs Sean Christopherson
2020-09-23 18:44 ` [PATCH v2 2/7] KVM: nVMX: Reload vmcs01 if getting vmcs12's pages fails Sean Christopherson
2020-09-23 18:44 ` [PATCH v2 3/7] KVM: nVMX: Explicitly check for valid guest state for !unrestricted guest Sean Christopherson
2020-09-25 21:33 ` Paolo Bonzini [this message]
2020-09-23 18:44 ` [PATCH v2 4/7] KVM: nVMX: Move free_nested() below vmx_switch_vmcs() Sean Christopherson
2020-09-23 18:44 ` [PATCH v2 5/7] KVM: nVMX: Ensure vmcs01 is the loaded VMCS when freeing nested state Sean Christopherson
2020-09-23 18:44 ` [PATCH v2 6/7] KVM: nVMX: Drop redundant VMCS switch and free_nested() call Sean Christopherson
2020-09-23 18:44 ` [PATCH v2 7/7] KVM: nVMX: WARN on attempt to switch the currently loaded VMCS Sean Christopherson
2020-09-25 21:35 ` [PATCH v2 0/7] KVM: nVMX: Bug fixes and cleanup 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=0fc761eb-8758-ae96-65b1-90cc4d32f043@redhat.com \
--to=pbonzini@redhat.com \
--cc=dcross@google.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pshier@google.com \
--cc=sean.j.christopherson@intel.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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
all inboxes | Powered by JetHome®