]> www.infradead.org Git - users/hch/misc.git/commitdiff
Drivers: hv: Add CONFIG_HYPERV_VMBUS option
authorMukesh Rathor <mrathor@linux.microsoft.com>
Mon, 15 Sep 2025 23:46:03 +0000 (16:46 -0700)
committerWei Liu <wei.liu@kernel.org>
Wed, 1 Oct 2025 00:00:42 +0000 (00:00 +0000)
At present VMBus driver is hinged off of CONFIG_HYPERV which entails
lot of builtin code and encompasses too much. It's not always clear
what depends on builtin hv code and what depends on VMBus. Setting
CONFIG_HYPERV as a module and fudging the Makefile to switch to builtin
adds even more confusion. VMBus is an independent module and should have
its own config option. Also, there are scenarios like baremetal dom0/root
where support is built in with CONFIG_HYPERV but without VMBus. Lastly,
there are more features coming down that use CONFIG_HYPERV and add more
dependencies on it.

So, create a fine grained HYPERV_VMBUS option and update Kconfigs for
dependency on VMBus.

Signed-off-by: Mukesh Rathor <mrathor@linux.microsoft.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com> # drivers/pci
Signed-off-by: Wei Liu <wei.liu@kernel.org>
12 files changed:
drivers/gpu/drm/Kconfig
drivers/hid/Kconfig
drivers/hv/Kconfig
drivers/hv/Makefile
drivers/input/serio/Kconfig
drivers/net/hyperv/Kconfig
drivers/pci/Kconfig
drivers/scsi/Kconfig
drivers/uio/Kconfig
drivers/video/fbdev/Kconfig
include/asm-generic/mshyperv.h
net/vmw_vsock/Kconfig

index f7ea8e895c0c0e17ee39364e0e832cd17571358f..58f34da061c6ff17a0cb0639015744f501e72161 100644 (file)
@@ -398,7 +398,7 @@ source "drivers/gpu/drm/imagination/Kconfig"
 
 config DRM_HYPERV
        tristate "DRM Support for Hyper-V synthetic video device"
-       depends on DRM && PCI && HYPERV
+       depends on DRM && PCI && HYPERV_VMBUS
        select DRM_CLIENT_SELECTION
        select DRM_KMS_HELPER
        select DRM_GEM_SHMEM_HELPER
index a57901203aeb284acd23be727d2fad0c137c101c..fe3dc8c0db994c510fb6c41267bbef9cebcf3c5c 100644 (file)
@@ -1162,7 +1162,7 @@ config GREENASIA_FF
 
 config HID_HYPERV_MOUSE
        tristate "Microsoft Hyper-V mouse driver"
-       depends on HYPERV
+       depends on HYPERV_VMBUS
        help
        Select this option to enable the Hyper-V mouse driver.
 
index e24f6299c376097803487c581c35dd2f8b109f2a..29f8637f441a680661afe9aafc0f79dd5a029672 100644 (file)
@@ -45,18 +45,25 @@ config HYPERV_TIMER
 
 config HYPERV_UTILS
        tristate "Microsoft Hyper-V Utilities driver"
-       depends on HYPERV && CONNECTOR && NLS
+       depends on HYPERV_VMBUS && CONNECTOR && NLS
        depends on PTP_1588_CLOCK_OPTIONAL
        help
          Select this option to enable the Hyper-V Utilities.
 
 config HYPERV_BALLOON
        tristate "Microsoft Hyper-V Balloon driver"
-       depends on HYPERV
+       depends on HYPERV_VMBUS
        select PAGE_REPORTING
        help
          Select this option to enable Hyper-V Balloon driver.
 
+config HYPERV_VMBUS
+       tristate "Microsoft Hyper-V VMBus driver"
+       depends on HYPERV
+       default HYPERV
+       help
+         Select this option to enable Hyper-V Vmbus driver.
+
 config MSHV_ROOT
        tristate "Microsoft Hyper-V root partition support"
        depends on HYPERV && (X86_64 || ARM64)
index 976189c725dcf50fd4ad7216a195f1df217680e8..4bb41663767db4fadd7c0bc0c5474f59371bfb24 100644 (file)
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_HYPERV)           += hv_vmbus.o
+obj-$(CONFIG_HYPERV_VMBUS)     += hv_vmbus.o
 obj-$(CONFIG_HYPERV_UTILS)     += hv_utils.o
 obj-$(CONFIG_HYPERV_BALLOON)   += hv_balloon.o
 obj-$(CONFIG_MSHV_ROOT)                += mshv_root.o
index 17edc1597446f2643b362d9bee123295d336dbb2..c7ef347a4dffc71e16c17a778c58efbab3678837 100644 (file)
@@ -276,8 +276,8 @@ config SERIO_OLPC_APSP
 
 config HYPERV_KEYBOARD
        tristate "Microsoft Synthetic Keyboard driver"
-       depends on HYPERV
-       default HYPERV
+       depends on HYPERV_VMBUS
+       default HYPERV_VMBUS
        help
          Select this option to enable the Hyper-V Keyboard driver.
 
index c8cbd85adcf99527f947f4b5a63dc616b533987e..982964c1a9fb97ba7ae49c5829bfce128bae3a4f 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config HYPERV_NET
        tristate "Microsoft Hyper-V virtual network driver"
-       depends on HYPERV
+       depends on HYPERV_VMBUS
        select UCS2_STRING
        select NLS
        help
index 9a249c65aedcd6b55437df3e8fb7b72c3985a283..7065a8e5f9b14fd307892eba131f08e29db8e6c2 100644 (file)
@@ -221,7 +221,7 @@ config PCI_LABEL
 
 config PCI_HYPERV
        tristate "Hyper-V PCI Frontend"
-       depends on ((X86 && X86_64) || ARM64) && HYPERV && PCI_MSI && SYSFS
+       depends on ((X86 && X86_64) || ARM64) && HYPERV_VMBUS && PCI_MSI && SYSFS
        select PCI_HYPERV_INTERFACE
        select IRQ_MSI_LIB
        help
index 5522310bab8d16188d8389e50b7feb3acf96e221..19d0884479a247f1e91300bcfc1112e7b3ea5e46 100644 (file)
@@ -589,7 +589,7 @@ config XEN_SCSI_FRONTEND
 
 config HYPERV_STORAGE
        tristate "Microsoft Hyper-V virtual storage driver"
-       depends on SCSI && HYPERV
+       depends on SCSI && HYPERV_VMBUS
        depends on m || SCSI_FC_ATTRS != m
        default HYPERV
        help
index b060dcd7c6350191726c0830a1ae7b9a388ca4bb..6f86a61231e668bddbad55f25cf3aa2d5546e5ae 100644 (file)
@@ -140,7 +140,7 @@ config UIO_MF624
 
 config UIO_HV_GENERIC
        tristate "Generic driver for Hyper-V VMBus"
-       depends on HYPERV
+       depends on HYPERV_VMBUS
        help
          Generic driver that you can bind, dynamically, to any
          Hyper-V VMBus device. It is useful to provide direct access
index c21484d15f0cbde9b8396688f2a60c3c72456c0e..72c63eaeb983aa5ee9f55b413b2e77a751a0c5a1 100644 (file)
@@ -1774,7 +1774,7 @@ config FB_BROADSHEET
 
 config FB_HYPERV
        tristate "Microsoft Hyper-V Synthetic Video support"
-       depends on FB && HYPERV
+       depends on FB && HYPERV_VMBUS
        select DMA_CMA if HAVE_DMA_CONTIGUOUS && CMA
        select FB_IOMEM_HELPERS_DEFERRED
        help
index dbd4c2f3aee32f2504ca84ca3e6bf66905afdc57..64ba6bc807d9821ecef46a07ad88965d4b15c97d 100644 (file)
@@ -163,6 +163,7 @@ static inline u64 hv_generate_guest_id(u64 kernel_version)
        return guest_id;
 }
 
+#if IS_ENABLED(CONFIG_HYPERV_VMBUS)
 /* Free the message slot and signal end-of-message if required */
 static inline void vmbus_signal_eom(struct hv_message *msg, u32 old_msg_type)
 {
@@ -198,6 +199,10 @@ static inline void vmbus_signal_eom(struct hv_message *msg, u32 old_msg_type)
        }
 }
 
+extern int vmbus_interrupt;
+extern int vmbus_irq;
+#endif /* CONFIG_HYPERV_VMBUS */
+
 int hv_get_hypervisor_version(union hv_hypervisor_version_info *info);
 
 void hv_setup_vmbus_handler(void (*handler)(void));
@@ -211,9 +216,6 @@ void hv_setup_crash_handler(void (*handler)(struct pt_regs *regs));
 void hv_remove_crash_handler(void);
 void hv_setup_mshv_handler(void (*handler)(void));
 
-extern int vmbus_interrupt;
-extern int vmbus_irq;
-
 #if IS_ENABLED(CONFIG_HYPERV)
 /*
  * Hypervisor's notion of virtual processor ID is different from
index 56356d2980c805defe3f898359f6d28d4ac36009..8e803c4828c429d9390fd857d297fdc8617bab64 100644 (file)
@@ -72,7 +72,7 @@ config VIRTIO_VSOCKETS_COMMON
 
 config HYPERV_VSOCKETS
        tristate "Hyper-V transport for Virtual Sockets"
-       depends on VSOCKETS && HYPERV
+       depends on VSOCKETS && HYPERV_VMBUS
        help
          This module implements a Hyper-V transport for Virtual Sockets.