x86: make VMware support optional
Subsystems (9)
PATCH v2 1/2 x86: make VMware support optional
Make it possible to opt-out from VMware support, for minimized kernels that never will be run under Vmware (eg. high-density virtualization or embedded systems).
Average distro kernel will leave it on, therefore default to y.
--- arch/x86/Kconfig | 11 +++++++++++ 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, 19 insertions(+), 4 deletions(-)
arch/x86/Kconfig +11 -0
@@ -801,6 +801,17 @@ 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. + + Disabling it saves a few kb, for stripped down kernels eg. in high + density virtualization or embedded systems running (para)virtualized + workloads. + config KVM_GUEST bool "KVM Guest support (including kvmclock)" depends on PARAVIRT
arch/x86/kernel/cpu/Makefile +3 -1
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH v2 2/2 x86: make Hyper-V support optional
Make it possible to opt-out from Hyper-V support, for minimized kernels that never will by run under Hyper-V. (eg. high-density virtualization or embedded systems)
Average distro kernel will leave it on, therefore default to y.
--- arch/x86/Kconfig | 11 +++++++++++ arch/x86/kernel/cpu/Makefile | 4 ++-- arch/x86/kernel/cpu/hypervisor.c | 2 ++ drivers/hv/Kconfig | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-)
arch/x86/Kconfig +11 -0
@@ -812,6 +812,17 @@ config VMWARE_GUEST density virtualization or embedded systems running (para)virtualized workloads. +config HYPERV_GUEST + bool "Hyper-V Guest support" + default y + help + This option enables several optimizations for running under the + Hyper-V hypervisor. + + Disabling it saves a few kb, for stripped down kernels eg. in high + density virtualization or embedded systems running (para)virtualized + workloads. + config KVM_GUEST bool "KVM Guest support (including kvmclock)" depends on PARAVIRT
arch/x86/kernel/cpu/Makefile +2 -2
@@ -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
@@ -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
@@ -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
Re: [PATCH v2 2/2] x86: make Hyper-V support optional
Quoted 20 lines · metux IT consult
Make it possible to opt-out from Hyper-V support, for minimized kernels that never will by run under Hyper-V. (eg. high-density virtualization or embedded systems)
Average distro kernel will leave it on, therefore default to y.
Signed-off-by Enrico Weigelt <[email protected]>--- arch/x86/Kconfig | 11 +++++++++++ arch/x86/kernel/cpu/Makefile | 4 ++-- arch/x86/kernel/cpu/hypervisor.c | 2 ++ drivers/hv/Kconfig | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-)arch/x86/Kconfig +0
-0@@ -812,6 +812,17 @@ config VMWARE_GUEST density virtualization or embedded systems running (para)virtualized
arch/x86/Kconfig config VMWARE_GUEST · line 822
Quoted 10 lines
arch/x86/Kconfig +8
-0workloads. +config HYPERV_GUEST + bool "Hyper-V Guest support" + default y + help + This option enables several optimizations for running under the + Hyper-V hypervisor. + + Disabling it saves a few kb, for stripped down kernels eg. in high
kB, e.g.
Quoted 6 lines
arch/x86/Kconfig +3
-0+ density virtualization or embedded systems running (para)virtualized + workloads. + config KVM_GUEST bool "KVM Guest support (including kvmclock)" depends on PARAVIRT
Signature · 1 line
~Randy
Quoted 22 lines · metux IT consult
Make it possible to opt-out from VMware support, for minimized kernels that never will be run under Vmware (eg. high-density virtualization or embedded systems).
Average distro kernel will leave it on, therefore default to y.
Signed-off-by Enrico Weigelt <[email protected]>--- arch/x86/Kconfig | 11 +++++++++++ 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, 19 insertions(+), 4 deletions(-)arch/x86/Kconfig +0
-0@@ -801,6 +801,17 @@ config X86_HV_CALLBACK_VECTOR
arch/x86/Kconfig config X86_HV_CALLBACK_VECTOR · line 811
Quoted 10 lines
arch/x86/Kconfig +8
-0source "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. + + Disabling it saves a few kb, for stripped down kernels eg. in high
kB or KiB or even KB, but not kb e.g.
Quoted 6 lines
arch/x86/Kconfig +3
-0+ density virtualization or embedded systems running (para)virtualized + workloads. + config KVM_GUEST bool "KVM Guest support (including kvmclock)" depends on PARAVIRT
Signature · 1 line
~Randy
Borislav Petkov
maintainerQuoted 22 lines · metux IT consult
Make it possible to opt-out from VMware support, for minimized kernels that never will be run under Vmware (eg. high-density virtualization or embedded systems).
Average distro kernel will leave it on, therefore default to y.
Signed-off-by Enrico Weigelt <[email protected]>--- arch/x86/Kconfig | 11 +++++++++++ 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, 19 insertions(+), 4 deletions(-)arch/x86/Kconfig +0
-0@@ -801,6 +801,17 @@ config X86_HV_CALLBACK_VECTOR
arch/x86/Kconfig config X86_HV_CALLBACK_VECTOR · line 811
Quoted 10 lines
arch/x86/Kconfig +8
-0source "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. + + Disabling it saves a few kb, for stripped down kernels eg. in high
I was actually expecting for you to do your own measurements and show data. Anyway, I did it for you:
text data bss dec hex filename
15949304 127806978 36597916 180354198 abffc96 vmlinux.before 15947650 127802430 36602012 180352092 abff45c vmlinux.after
this is with my .config.
How much is it with a stripped down kernel? I bet it is even less. Which makes this whole effort not worth it...
Also, when you send a new version of your patches, please rework *all* review feedback you've received on the previous one.
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette