Skip to contentSkip to conversation

x86: make vmware support optional

PATCH Superseded Enrico Weigelt, metux IT consult 4 participants 6 messages Nov 17, 2020 – Dec 2, 2020

Subsystems (9)
Networking Network drivers x86 HID +5 more subsystems

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 x86: make vmware support optional

Make it possible to opt-out from vmware support

---
 arch/x86/Kconfig                 | 7 +++++++
 arch/x86/kernel/cpu/Makefile     | 4 +++-
 arch/x86/kernel/cpu/hypervisor.c | 2 ++
 drivers/input/mouse/Kconfig      | 2 +-
 drivers/misc/Kconfig             | 2 +-
 drivers/ptp/Kconfig              | 2 +-
 6 files changed, 15 insertions(+), 4 deletions(-)
arch/x86/Kconfig +7 -0
index f6946b81f74a..c227c1fa0091 100644
@@ -801,6 +801,13 @@ config X86_HV_CALLBACK_VECTOR
 
 source "arch/x86/xen/Kconfig"
 
+config VMWARE_GUEST
+	bool "Vmware Guest support"
+	default y
+	help
+	  This option enables several optimizations for running under the
+	  VMware hypervisor.
+
 config KVM_GUEST
 	bool "KVM Guest support (including kvmclock)"
 	depends on PARAVIRT
arch/x86/kernel/cpu/Makefile +3 -1
index 93792b457b81..a615b0152bf0 100644
@@ -51,7 +51,9 @@ obj-$(CONFIG_X86_CPU_RESCTRL)		+= resctrl/
 
 obj-$(CONFIG_X86_LOCAL_APIC)		+= perfctr-watchdog.o
 
-obj-$(CONFIG_HYPERVISOR_GUEST)		+= vmware.o hypervisor.o mshyperv.o
+obj-$(CONFIG_HYPERVISOR_GUEST)		+= hypervisor.o mshyperv.o
+obj-$(CONFIG_VMWARE_GUEST)		+= vmware.o
+
 obj-$(CONFIG_ACRN_GUEST)		+= acrn.o
 
 ifdef CONFIG_X86_FEATURE_NAMES
arch/x86/kernel/cpu/hypervisor.c +2 -0
index 553bfbfc3a1b..c0e770a224aa 100644
@@ -34,7 +34,9 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] =
 #ifdef CONFIG_XEN_PVHVM
 	&x86_hyper_xen_hvm,
 #endif
+#ifdef CONFIG_VMWARE_GUEST
 	&x86_hyper_vmware,
+#endif
 	&x86_hyper_ms_hyperv,
 #ifdef CONFIG_KVM_GUEST
 	&x86_hyper_kvm,
drivers/input/mouse/Kconfig +1 -1
index d8b6a5dab190..29ced69d5c85 100644
@@ -186,7 +186,7 @@ config MOUSE_PS2_FOCALTECH
 
 config MOUSE_PS2_VMMOUSE
 	bool "Virtual mouse (vmmouse)"
-	depends on MOUSE_PS2 && X86 && HYPERVISOR_GUEST
+	depends on MOUSE_PS2 && X86 && VMWARE_GUEST
 	help
 	  Say Y here if you are running under control of VMware hypervisor
 	  (ESXi, Workstation or Fusion). Also make sure that when you enable
drivers/misc/Kconfig +1 -1
index fafa8b0d8099..d2bd8eff6eb6 100644
@@ -363,7 +363,7 @@ config DS1682
 
 config VMWARE_BALLOON
 	tristate "VMware Balloon Driver"
-	depends on VMWARE_VMCI && X86 && HYPERVISOR_GUEST
+	depends on VMWARE_VMCI && X86 && VMWARE_GUEST
 	select MEMORY_BALLOON
 	help
 	  This is VMware physical memory management driver which acts
drivers/ptp/Kconfig +1 -1
index 942f72d8151d..6bf30153270e 100644
@@ -141,7 +141,7 @@ config PTP_1588_CLOCK_IDTCM
 
 config PTP_1588_CLOCK_VMW
 	tristate "VMware virtual PTP clock"
-	depends on ACPI && HYPERVISOR_GUEST && X86
+	depends on ACPI && VMWARE_GUEST && X86
 	depends on PTP_1588_CLOCK
 	help
 	  This driver adds support for using VMware virtual precision
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 x86: make hyperv support optional

Make it possible to opt-out from hyperv support.

---
 arch/x86/Kconfig                 | 7 +++++++
 arch/x86/kernel/cpu/Makefile     | 4 ++--
 arch/x86/kernel/cpu/hypervisor.c | 2 ++
 drivers/hv/Kconfig               | 2 +-
 4 files changed, 12 insertions(+), 3 deletions(-)
arch/x86/Kconfig +7 -0
index c227c1fa0091..60aab344d6ab 100644
@@ -808,6 +808,13 @@ config VMWARE_GUEST
 	  This option enables several optimizations for running under the
 	  VMware hypervisor.
 
+config HYPERV_GUEST
+	bool "HyperV Guest support"
+	default y
+	help
+	  This option enables several optimizations for running under the
+	  HyperV hypervisor.
+
 config KVM_GUEST
 	bool "KVM Guest support (including kvmclock)"
 	depends on PARAVIRT
arch/x86/kernel/cpu/Makefile +2 -2
index a615b0152bf0..5536b801cb44 100644
@@ -51,9 +51,9 @@ obj-$(CONFIG_X86_CPU_RESCTRL)		+= resctrl/
 
 obj-$(CONFIG_X86_LOCAL_APIC)		+= perfctr-watchdog.o
 
-obj-$(CONFIG_HYPERVISOR_GUEST)		+= hypervisor.o mshyperv.o
+obj-$(CONFIG_HYPERVISOR_GUEST)		+= hypervisor.o
 obj-$(CONFIG_VMWARE_GUEST)		+= vmware.o
-
+obj-$(CONFIG_HYPERV_GUEST)		+= mshyperv.o
 obj-$(CONFIG_ACRN_GUEST)		+= acrn.o
 
 ifdef CONFIG_X86_FEATURE_NAMES
arch/x86/kernel/cpu/hypervisor.c +2 -0
index c0e770a224aa..32d6b2084d05 100644
@@ -37,7 +37,9 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] =
 #ifdef CONFIG_VMWARE_GUEST
 	&x86_hyper_vmware,
 #endif
+#ifdef CONFIG_HYPERV_GUEST
 	&x86_hyper_ms_hyperv,
+#endif
 #ifdef CONFIG_KVM_GUEST
 	&x86_hyper_kvm,
 #endif
drivers/hv/Kconfig +1 -1
index 79e5356a737a..7b3094c59a81 100644
@@ -4,7 +4,7 @@ menu "Microsoft Hyper-V guest support"
 
 config HYPERV
 	tristate "Microsoft Hyper-V client drivers"
-	depends on X86 && ACPI && X86_LOCAL_APIC && HYPERVISOR_GUEST
+	depends on X86 && ACPI && X86_LOCAL_APIC && HYPERV_GUEST
 	select PARAVIRT
 	select X86_HV_CALLBACK_VECTOR
 	help
Signature · 1 line
2.11.0
maintainer
#3 lore raw
In reply to Enrico Weigelt, metux IT consult
Quoted 1 line · metux IT consult

Make it possible to opt-out from vmware support

Why?

I can think of a couple of reasons but maybe yours might not be the one I'm thinking of.

Quoted 15 lines
---
 arch/x86/Kconfig                 | 7 +++++++
 arch/x86/kernel/cpu/Makefile     | 4 +++-
 arch/x86/kernel/cpu/hypervisor.c | 2 ++
 drivers/input/mouse/Kconfig      | 2 +-
 drivers/misc/Kconfig             | 2 +-
 drivers/ptp/Kconfig              | 2 +-
 6 files changed, 15 insertions(+), 4 deletions(-)
arch/x86/Kconfig +0 -0
index f6946b81f74a..c227c1fa0091 100644

arch/x86/Kconfig config X86_HV_CALLBACK_VECTOR · line 806

Quoted 6 lines
arch/x86/Kconfig +3 -0
@@ -801,6 +801,13 @@ config X86_HV_CALLBACK_VECTOR
 
 source "arch/x86/xen/Kconfig"
 
+config VMWARE_GUEST
+	bool "Vmware Guest support"
+	default y

depends on HYPERVISOR_GUEST. The hyperv one too.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
maintainer
#2 lore raw

Re: [PATCH 2/2] x86: make hyperv support optional

In reply to Enrico Weigelt, metux IT consult
Quoted 2 lines · metux IT consult

Make it possible to opt-out from hyperv support.

"Hyper-V support".

Have you tested this patch? If so, how?

Quoted 13 lines
---
 arch/x86/Kconfig                 | 7 +++++++
 arch/x86/kernel/cpu/Makefile     | 4 ++--
 arch/x86/kernel/cpu/hypervisor.c | 2 ++
 drivers/hv/Kconfig               | 2 +-
 4 files changed, 12 insertions(+), 3 deletions(-)
arch/x86/Kconfig +0 -0
index c227c1fa0091..60aab344d6ab 100644

arch/x86/Kconfig config VMWARE_GUEST · line 812

Quoted 5 lines
arch/x86/Kconfig +2 -0
@@ -808,6 +808,13 @@ config VMWARE_GUEST
 	  This option enables several optimizations for running under the
 	  VMware hypervisor.
 
+config HYPERV_GUEST
+	bool "HyperV Guest support"

Hyper-V here.

arch/x86/Kconfig config VMWARE_GUEST · line 817

Quoted 5 lines
arch/x86/Kconfig +5 -0
+	default y
+	help
+	  This option enables several optimizations for running under the
+	  HyperV hypervisor.
+

"for running under Hyper-V".

Quoted 38 lines
arch/x86/Kconfig +0 -0
 config KVM_GUEST
 	bool "KVM Guest support (including kvmclock)"
 	depends on PARAVIRT
arch/x86/kernel/cpu/Makefile +2 -2
index a615b0152bf0..5536b801cb44 100644
@@ -51,9 +51,9 @@ obj-$(CONFIG_X86_CPU_RESCTRL)		+= resctrl/
 
 obj-$(CONFIG_X86_LOCAL_APIC)		+= perfctr-watchdog.o
 
-obj-$(CONFIG_HYPERVISOR_GUEST)		+= hypervisor.o mshyperv.o
+obj-$(CONFIG_HYPERVISOR_GUEST)		+= hypervisor.o
 obj-$(CONFIG_VMWARE_GUEST)		+= vmware.o
-
+obj-$(CONFIG_HYPERV_GUEST)		+= mshyperv.o
 obj-$(CONFIG_ACRN_GUEST)		+= acrn.o
 
 ifdef CONFIG_X86_FEATURE_NAMES
arch/x86/kernel/cpu/hypervisor.c +2 -0
index c0e770a224aa..32d6b2084d05 100644
@@ -37,7 +37,9 @@ static const __initconst struct hypervisor_x86 * const hypervisors[] =
 #ifdef CONFIG_VMWARE_GUEST
 	&x86_hyper_vmware,
 #endif
+#ifdef CONFIG_HYPERV_GUEST
 	&x86_hyper_ms_hyperv,
+#endif
 #ifdef CONFIG_KVM_GUEST
 	&x86_hyper_kvm,
 #endif
drivers/hv/Kconfig +0 -0
index 79e5356a737a..7b3094c59a81 100644

drivers/hv/Kconfig menu "Microsoft Hyper-V guest support" · line 10

Quoted 8 lines
drivers/hv/Kconfig +1 -1
@@ -4,7 +4,7 @@ menu "Microsoft Hyper-V guest support"
 
 config HYPERV
 	tristate "Microsoft Hyper-V client drivers"
-	depends on X86 && ACPI && X86_LOCAL_APIC && HYPERVISOR_GUEST
+	depends on X86 && ACPI && X86_LOCAL_APIC && HYPERV_GUEST
 	select PARAVIRT
 	select X86_HV_CALLBACK_VECTOR
 	help

Maybe that one should be moved to x86/Kconfig and used instead?

Wei.

Quoted 3 lines
Signature · 1 line
2.11.0
#4 lore raw
In reply to Borislav Petkov
Quoted 4 lines · Borislav Petkov
Quoted 1 line · metux IT consult

Make it possible to opt-out from vmware support

Why?

Reducing the kernel size. Think of very high density virtualization (w/ specially stripped-down workloads) or embedded systems.

For example, I'm running bare minimum kernels w/ only kvm and virtio (not even pci, etc) in such scenarios.

Of course, that's nothing for an average distro, therefore leaving default y.

--mtx

Quoted 28 lines

I can think of a couple of reasons but maybe yours might not be the one I'm thinking of.

Quoted 15 lines
---
 arch/x86/Kconfig                 | 7 +++++++
 arch/x86/kernel/cpu/Makefile     | 4 +++-
 arch/x86/kernel/cpu/hypervisor.c | 2 ++
 drivers/input/mouse/Kconfig      | 2 +-
 drivers/misc/Kconfig             | 2 +-
 drivers/ptp/Kconfig              | 2 +-
 6 files changed, 15 insertions(+), 4 deletions(-)
arch/x86/Kconfig +0 -0
index f6946b81f74a..c227c1fa0091 100644

arch/x86/Kconfig config X86_HV_CALLBACK_VECTOR · line 806

Quoted 6 lines
arch/x86/Kconfig +3 -0
@@ -801,6 +801,13 @@ config X86_HV_CALLBACK_VECTOR
 
 source "arch/x86/xen/Kconfig"
 
+config VMWARE_GUEST
+	bool "Vmware Guest support"
+	default y

depends on HYPERVISOR_GUEST. The hyperv one too.

Signature · 8 lines
---
Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert
werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren
GPG/PGP-Schlüssel zu.
---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
[email protected] -- +49-151-27565287
maintainer
#5 lore raw
Quoted 8 lines · metux IT consult

Reducing the kernel size. Think of very high density virtualization (w/ specially stripped-down workloads) or embedded systems.

For example, I'm running bare minimum kernels w/ only kvm and virtio (not even pci, etc) in such scenarios.

Of course, that's nothing for an average distro, therefore leaving default y.

Ok, pls put the reasoning for the change in the next revision's commit message along with how much KB savings we're talking about.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette