From patchwork Wed Dec 2 21:19:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 337605 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56AA2C64E7C for ; Wed, 2 Dec 2020 21:23:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02E8322203 for ; Wed, 2 Dec 2020 21:23:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731194AbgLBVW4 (ORCPT ); Wed, 2 Dec 2020 16:22:56 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:48861 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727984AbgLBVWz (ORCPT ); Wed, 2 Dec 2020 16:22:55 -0500 Received: from orion.localdomain ([77.7.48.174]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M6m1g-1koRgX3GjG-008HQP; Wed, 02 Dec 2020 22:19:51 +0100 From: "Enrico Weigelt, metux IT consult" 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 Message-Id: <20201202211949.17730-1-info@metux.net> X-Mailer: git-send-email 2.11.0 X-Provags-ID: V03:K1:M0EvxXaN0cRaHbPb8XuaI2edSaP/HobpTTCXvKZQcRBzxPyGwa2 hxQPq6hkNWD7lhx7Ultkh+X2isbJiePeNcLHbYGU62gCjXBeWg4AuE2MZPekNAvZ4IG0RxF YuUQig9sZl2yIJZnnZdp3XA/4ora9PFX77d265Abp9z4DI0lp+APR2zl9mrl/Wf0O5sPYuC RmyvbQjvu5s4+QPjEm7Xw== X-UI-Out-Filterresults: notjunk:1; V03:K0:+CqD6IYdmE8=:kS66WbhQji/2ME7GMaJYJR w6XzE7zbaNfUXV7qFiHPptu7c4KQCnWI3gsuhwwT0YHxp4DFsH/gM8COfBmFS3n/1Drkwvn0m 2+VgFPfB5U5T6Ie6C9reiZvaayx1E9BNWqDAAowdZdEa/7xVGTbyo6jmT9tKbrVOzltjwLU3S BpWxLKZtIaWBW1Ey2RVn/+nZ7xIycyo+50JG0ocCDH5ZQwpDjwXoIhfYawmZNfITrxuHsmEU9 l2eXsGCF1Gq71rjJgNDFSdSRCTRTY3LopjX9WepmvqXSHN1BQiUV2rHhW6hjpGgs0rCzItQi3 b0fIFlv6/HfcmLOXDkhg5QWWSFyMGOnpkVqoxwB1oWjUK0sST3LrFl2HqrPwuCGI6l38L4iZS GS4WG827aqqSldQOmuwwgfGvyf/HOEcLFPotsmUsEdsK/+2UWFscce7pZWtOS Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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 From patchwork Wed Dec 2 21:19:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Enrico Weigelt, metux IT consult" X-Patchwork-Id: 336530 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98730C8300F for ; Wed, 2 Dec 2020 21:23:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F2BE22249 for ; Wed, 2 Dec 2020 21:23:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730697AbgLBVWz (ORCPT ); Wed, 2 Dec 2020 16:22:55 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:49579 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727772AbgLBVWy (ORCPT ); Wed, 2 Dec 2020 16:22:54 -0500 Received: from orion.localdomain ([77.7.48.174]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N4hBx-1k4jqp1hY7-011lWC; Wed, 02 Dec 2020 22:19:52 +0100 From: "Enrico Weigelt, metux IT consult" 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 2/2] x86: make Hyper-V support optional Date: Wed, 2 Dec 2020 22:19:49 +0100 Message-Id: <20201202211949.17730-2-info@metux.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20201202211949.17730-1-info@metux.net> References: <20201202211949.17730-1-info@metux.net> X-Provags-ID: V03:K1:ZYw8JALVJyM7+za0bb7JmaCzzkuqUcrysb74jSbDe7uDw14f2UV vdlkaMrjlMmq4uyMuGRmD9OZbCTRRKrCLuendqIOAn2gg4DNusUa+hAdknrE+ZI9jFT9u4s xjWldC7c477x6uphyaHewlc00iTZVx6lm7ENjYAu5nLL0yVt58pb4JI+AymvGxfp2VYszzg xQI/vRldWoOHMfKFk23Mw== X-UI-Out-Filterresults: notjunk:1; V03:K0:SsW/Vx7eYCw=:zIS1LJ0NodFzrr2suQ0yaF j72DldIEnk06X32w5FJ1IP3lcj4G6cTYvNPUphwmT4OdwbNvac9HFiBmB8w6AwTzZyU7Ik7jY e30Tx/r2YicPKUGV4dShnlyGJ4ENU/J/siK3nxDXoqCqujOcxW1T0sYxq0Q49Apt075LJpdg4 cJbDddQBqG5pG0hUwJw0DU8ohtKFuN4RWKn8hjcpNDZlstgeWqZNUEul9rFfqOZitUlQCfidH 4LkbOlD6J7KKT3+CSA0nLjXfrC9WGyerneO9j1K1ZSwBVtQPKTxUXI2WAysMrPOXg+aSO30eC sgl7t3xt7dA/smbOGwApOUsLQ/4vQ+UphimZDC74T7f2k7lrLYO/PVxbX4J4VTxwjplm1/HZ3 n/h+68yvBjtHHhnUaMhQBEWfl5dyS5BPhuwQjmxUzQ2pzCTzkqYJXM4xv3QGK Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index eff12460cb3c..57d20591d6ee 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -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 diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile index a615b0152bf0..5536b801cb44 100644 --- a/arch/x86/kernel/cpu/Makefile +++ b/arch/x86/kernel/cpu/Makefile @@ -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 diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c index c0e770a224aa..32d6b2084d05 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++ b/arch/x86/kernel/cpu/hypervisor.c @@ -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 diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig index 79e5356a737a..7b3094c59a81 100644 --- a/drivers/hv/Kconfig +++ b/drivers/hv/Kconfig @@ -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