linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Enrico Weigelt, metux IT consult" <info@metux.net>
To: linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	x86@kernel.org, hpa@zytor.com, dmitry.torokhov@gmail.com,
	derek.kiernan@xilinx.com, dragan.cvetic@xilinx.com,
	richardcochran@gmail.com, linux-hyperv@vger.kernel.org,
	linux-input@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH v2 1/2] x86: make VMware support optional
Date: Wed,  2 Dec 2020 22:19:48 +0100	[thread overview]
Message-ID: <20201202211949.17730-1-info@metux.net> (raw)

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 <info@metux.net>
---
 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(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index f6946b81f74a..eff12460cb3c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -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
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 93792b457b81..a615b0152bf0 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -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
diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c
index 553bfbfc3a1b..c0e770a224aa 100644
--- a/arch/x86/kernel/cpu/hypervisor.c
+++ b/arch/x86/kernel/cpu/hypervisor.c
@@ -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,
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index d8b6a5dab190..29ced69d5c85 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -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
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index fafa8b0d8099..d2bd8eff6eb6 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -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
diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
index 942f72d8151d..6bf30153270e 100644
--- a/drivers/ptp/Kconfig
+++ b/drivers/ptp/Kconfig
@@ -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
-- 
2.11.0


             reply	other threads:[~2020-12-02 21:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02 21:19 Enrico Weigelt, metux IT consult [this message]
2020-12-02 21:19 ` [PATCH v2 2/2] x86: make Hyper-V " Enrico Weigelt, metux IT consult
2020-12-02 21:58   ` Randy Dunlap
2020-12-02 21:59 ` [PATCH v2 1/2] x86: make VMware " Randy Dunlap
2020-12-03  7:46 ` Borislav Petkov

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=20201202211949.17730-1-info@metux.net \
    --to=info@metux.net \
    --cc=bp@alien8.de \
    --cc=derek.kiernan@xilinx.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dragan.cvetic@xilinx.com \
    --cc=hpa@zytor.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --subject='Re: [PATCH v2 1/2] x86: make VMware support optional' \
    /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

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).