public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Maxim Levitsky <mlevitsk@redhat.com>,
	kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 07/11] KVM: x86: Make Hyper-V emulation optional
Date: Mon, 16 Oct 2023 08:27:01 -0700	[thread overview]
Message-ID: <ZS1VGvbcmH93-KyH@google.com> (raw)
In-Reply-To: <87h6mq91al.fsf@redhat.com>

On Mon, Oct 16, 2023, Vitaly Kuznetsov wrote:
> Maxim Levitsky <mlevitsk@redhat.com> writes:
> 
> > У вт, 2023-10-10 у 18:02 +0200, Vitaly Kuznetsov пише:
> >> Hyper-V emulation in KVM is a fairly big chunk and in some cases it may be
> >> desirable to not compile it in to reduce module sizes as well as attack
> >> surface. Introduce CONFIG_KVM_HYPERV option to make it possible.
> >> 
> >> Note, there's room for further nVMX/nSVM code optimizations when
> >> !CONFIG_KVM_HYPERV, this will be done in follow-up patches.
> >
> > Maybe CONFIG_KVM_HYPERV_GUEST_SUPPORT or CONFIG_HYPERV_ON_KVM instead?
> >
> > IMHO CONFIG_KVM_HYPERV_GUEST_SUPPORT sounds good.

Adding GUEST_SUPPORT doesn't disambiguate anything though, as there's no clear
indication of whether KVM or Hyper-V is the guest.  E.g. the umbrella kconfig for
Linux-as-a-guest is CONFIG_HYPERVISOR_GUEST.

> We already have CONFIG_KVM_XEN so I decided to stay concise. I do
> understand that 'KVM-on-Hyper-V' and 'Hyper-V-on-KVM' mess which creates
> the confusion though.

Yeah, matching Xen is probably the best way to minimize confusion, e.g. the kernel
has CONFIG_HYPERV and CONFIG_XEN to go with KVM's, CONFIG_KVM_HYPERV and CONFIG_KVM_XEN.

> >> diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
> >> index ed90f148140d..a06e19a8a8f6 100644
> >> --- a/arch/x86/kvm/Kconfig
> >> +++ b/arch/x86/kvm/Kconfig
> >> @@ -129,6 +129,15 @@ config KVM_SMM
> >>  
> >>  	  If unsure, say Y.
> >>  
> >> +config KVM_HYPERV
> >> +	bool "Support for Microsoft Hyper-V emulation"
> >> +	depends on KVM
> >> +	default y
> >> +	help
> >> +	  Provides KVM support for emulating Microsoft Hypervisor (Hyper-V).
> >
> >
> > It feels to me that the KConfig option can have a longer description.
> >
> > What do you think about something like that:
> >
> > "Provides KVM support for emulating Microsoft Hypervisor (Hyper-V).

I don't think we should put Hyper-V in parentheses, I haven't seen any documentation
that calls it "Microsoft Hypervisor", i.e. Hyper-V is the full and proper name.

> > This makes KVM expose a set of paravirtualized interfaces,

s/makes/allows, since KVM still requires userspace to opt-in to exposing Hyper-V.

> > documented in the HyperV TLFS, 

s/TLFS/spec?  Readers that aren't already familiar with Hyper-V will have no idea
what TLFS is until they click the link.

> > https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs,
> > which consists of a subset of paravirtualized interfaces that HyperV exposes

We can trim this paragraph by stating that KVM only supports a subset of the
PV interfaces straightaway.

> > to its guests.

E.g.

  Provides KVM support for for emulating Microsoft Hyper-V.  This allows KVM to
  expose a subset of the paravirtualized interfaces defined in Hyper-V's spec:
  https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs.

> >
> > This improves performance of modern Windows guests.

Isn't Hyper-V emulation effectively mandatory these days?  IIRC, modern versions
of Windows will fail to boot if they detect a hypervisor but the core Hyper-V
interfaces aren't supported.

  reply	other threads:[~2023-10-16 15:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 16:02 [PATCH RFC 00/11] KVM: x86: Make Hyper-V emulation optional (AKA introduce CONFIG_KVM_HYPERV) Vitaly Kuznetsov
2023-10-10 16:02 ` [PATCH RFC 01/11] KVM: x86: xen: Remove unneeded xen context from struct kvm_arch when !CONFIG_KVM_XEN Vitaly Kuznetsov
2023-10-12 19:30   ` Maxim Levitsky
2023-10-10 16:02 ` [PATCH RFC 02/11] KVM: x86: hyper-v: Move Hyper-V partition assist page out of Hyper-V emulation context Vitaly Kuznetsov
2023-10-12 19:35   ` Maxim Levitsky
2023-10-16 12:45     ` Vitaly Kuznetsov
2023-10-10 16:02 ` [PATCH RFC 03/11] KVM: VMX: Split off vmx_onhyperv.{ch} from hyperv.{ch} Vitaly Kuznetsov
2023-10-12 19:36   ` Maxim Levitsky
2023-10-10 16:02 ` [PATCH RFC 04/11] KVM: x86: hyper-v: Introduce kvm_hv_synic_auto_eoi_set() Vitaly Kuznetsov
2023-10-12 19:36   ` Maxim Levitsky
2023-10-10 16:02 ` [PATCH RFC 05/11] KVM: x86: hyper-v: Introduce kvm_hv_synic_has_vector() Vitaly Kuznetsov
2023-10-12 19:36   ` Maxim Levitsky
2023-10-10 16:02 ` [PATCH RFC 06/11] KVM: VMX: Split off hyperv_evmcs.{ch} Vitaly Kuznetsov
2023-10-12 19:40   ` Maxim Levitsky
2023-10-16 12:47     ` Vitaly Kuznetsov
2023-10-10 16:02 ` [PATCH RFC 07/11] KVM: x86: Make Hyper-V emulation optional Vitaly Kuznetsov
2023-10-12 19:49   ` Maxim Levitsky
2023-10-16 12:53     ` Vitaly Kuznetsov
2023-10-16 15:27       ` Sean Christopherson [this message]
2023-10-16 15:43         ` Vitaly Kuznetsov
2023-10-16 16:45           ` Sean Christopherson
2023-10-10 16:02 ` [PATCH RFC 08/11] KVM: nVMX: hyper-v: Introduce nested_vmx_evmptr() accessor Vitaly Kuznetsov
2023-10-12 19:50   ` Maxim Levitsky
2023-10-16 13:49     ` Vitaly Kuznetsov
2023-10-16 16:55       ` Sean Christopherson
2023-10-10 16:02 ` [PATCH RFC 09/11] KVM: nVMX: hyper-v: Introduce nested_vmx_evmcs() accessor Vitaly Kuznetsov
2023-10-12 19:51   ` Maxim Levitsky
2023-10-10 16:02 ` [PATCH RFC 10/11] KVM: nVMX: hyper-v: Hide more stuff under CONFIG_KVM_HYPERV Vitaly Kuznetsov
2023-10-12 19:51   ` Maxim Levitsky
2023-10-10 16:03 ` [PATCH RFC 11/11] KVM: nSVM: hyper-v: Hide more stuff under CONFIG_KVM_HYPERV/CONFIG_HYPERV Vitaly Kuznetsov
2023-10-12 19:51   ` Maxim Levitsky

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=ZS1VGvbcmH93-KyH@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.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