kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Mattson <jmattson@google.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: "kvm list" <kvm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Joerg Roedel" <joro@8bytes.org>,
	"Sean Christopherson" <sean.j.christopherson@intel.com>,
	"Roman Kagan" <rkagan@virtuozzo.com>
Subject: Re: [PATCH 3/3] KVM: x86: announce KVM_CAP_HYPERV_ENLIGHTENED_VMCS support only when it is available
Date: Tue, 27 Aug 2019 09:54:39 -0700	[thread overview]
Message-ID: <CALMp9eRyabQA8v5cJ1AwmtFdNFvWQz2jQ+iGTRQjow7r4FV3xA@mail.gmail.com> (raw)
In-Reply-To: <20190827160404.14098-4-vkuznets@redhat.com>

On Tue, Aug 27, 2019 at 9:04 AM Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>
> It was discovered that after commit 65efa61dc0d5 ("selftests: kvm: provide
> common function to enable eVMCS") hyperv_cpuid selftest is failing on AMD.
> The reason is that the commit changed _vcpu_ioctl() to vcpu_ioctl() in the
> test and this one can't fail.
>
> Instead of fixing the test is seems to make more sense to not announce
> KVM_CAP_HYPERV_ENLIGHTENED_VMCS support if it is definitely missing
> (on svm and in case kvm_intel.nested=0).
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
>  arch/x86/kvm/x86.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index d1cd0fcff9e7..ef2e8b138300 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3106,7 +3106,6 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>         case KVM_CAP_HYPERV_EVENTFD:
>         case KVM_CAP_HYPERV_TLBFLUSH:
>         case KVM_CAP_HYPERV_SEND_IPI:
> -       case KVM_CAP_HYPERV_ENLIGHTENED_VMCS:
>         case KVM_CAP_HYPERV_CPUID:
>         case KVM_CAP_PCI_SEGMENT:
>         case KVM_CAP_DEBUGREGS:
> @@ -3183,6 +3182,8 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>                 r = kvm_x86_ops->get_nested_state ?
>                         kvm_x86_ops->get_nested_state(NULL, NULL, 0) : 0;
>                 break;
> +       case KVM_CAP_HYPERV_ENLIGHTENED_VMCS:
> +               r = kvm_x86_ops->nested_enable_evmcs != NULL;

You should probably have an explicit break here, in case someone later
adds another case below.

>         default:
>                 break;
>         }
> --
> 2.20.1
>

  reply	other threads:[~2019-08-27 16:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 16:04 [PATCH 0/3] KVM: x86: fix a couple of issues with Enlightened VMCS enablement Vitaly Kuznetsov
2019-08-27 16:04 ` [PATCH 1/3] KVM: x86: hyper-v: don't crash on KVM_GET_SUPPORTED_HV_CPUID when kvm_intel.nested is disabled Vitaly Kuznetsov
2019-08-27 17:09   ` Jim Mattson
2019-08-27 18:52   ` Radim Krčmář
2019-08-27 16:04 ` [PATCH 2/3] KVM: x86: svm: remove unneeded nested_enable_evmcs() hook Vitaly Kuznetsov
2019-08-27 16:57   ` Jim Mattson
2019-08-27 16:04 ` [PATCH 3/3] KVM: x86: announce KVM_CAP_HYPERV_ENLIGHTENED_VMCS support only when it is available Vitaly Kuznetsov
2019-08-27 16:54   ` Jim Mattson [this message]
2019-08-27 19:52     ` Sean Christopherson
2019-08-28  7:30       ` Vitaly Kuznetsov

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=CALMp9eRyabQA8v5cJ1AwmtFdNFvWQz2jQ+iGTRQjow7r4FV3xA@mail.gmail.com \
    --to=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkagan@virtuozzo.com \
    --cc=rkrcmar@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=vkuznets@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).