From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Subject: Re: [PATCH 2/3] KVM: eVMCS: check if nesting is enabled
Date: Mon, 20 Apr 2020 10:49:52 +0200 [thread overview]
Message-ID: <877dyatubz.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20200417164413.71885-3-pbonzini@redhat.com>
Paolo Bonzini <pbonzini@redhat.com> writes:
> In the next patch nested_get_evmcs_version will be always set in kvm_x86_ops for
> VMX, even if nesting is disabled. Therefore, check whether VMX (aka nesting)
> is available in the function, the caller will not do the check anymore.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> arch/x86/kvm/vmx/evmcs.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/evmcs.c b/arch/x86/kvm/vmx/evmcs.c
> index 73f3e07c1852..48dc77de9337 100644
> --- a/arch/x86/kvm/vmx/evmcs.c
> +++ b/arch/x86/kvm/vmx/evmcs.c
> @@ -4,6 +4,7 @@
> #include <linux/smp.h>
>
> #include "../hyperv.h"
> +#include "../cpuid.h"
> #include "evmcs.h"
> #include "vmcs.h"
> #include "vmx.h"
> @@ -333,7 +334,8 @@ uint16_t nested_get_evmcs_version(struct kvm_vcpu *vcpu)
> * maximum supported version. KVM supports versions from 1 to
> * KVM_EVMCS_VERSION.
> */
> - if (vmx->nested.enlightened_vmcs_enabled)
> + if (kvm_cpu_cap_get(X86_FEATURE_VMX) &&
> + vmx->nested.enlightened_vmcs_enabled)
> return (KVM_EVMCS_VERSION << 8) | 1;
>
> return 0;
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
--
Vitaly
next prev parent reply other threads:[~2020-04-20 8:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-17 16:44 [PATCH 0/3] KVM: x86: move nested-related kvm_x86_ops to a separate struct Paolo Bonzini
2020-04-17 16:44 ` [PATCH 1/3] KVM: x86: check_nested_events is never NULL Paolo Bonzini
2020-04-20 8:47 ` Vitaly Kuznetsov
2020-04-17 16:44 ` [PATCH 2/3] KVM: eVMCS: check if nesting is enabled Paolo Bonzini
2020-04-20 8:49 ` Vitaly Kuznetsov [this message]
2020-04-17 16:44 ` [PATCH 3/3] KVM: x86: move nested-related kvm_x86_ops to a separate struct Paolo Bonzini
2020-04-20 8:54 ` Vitaly Kuznetsov
2020-04-17 19:05 ` [PATCH 0/3] " Peter Xu
2020-04-17 19:11 ` Sean Christopherson
2020-04-18 9:55 ` 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=877dyatubz.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=sean.j.christopherson@intel.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
Powered by JetHome