RE: [PATCH net-next 1/3] VMCI: only load on VMware hypervisor

From: Dexuan Cui
Date: Wed Aug 16 2017 - 14:52:22 EST


> From: David Miller [mailto:davem@xxxxxxxxxxxxx]
> Sent: Wednesday, August 16, 2017 11:07
>
> From: Dexuan Cui <decui@xxxxxxxxxxxxx>
> Date: Tue, 15 Aug 2017 22:13:29 +0000
>
> > + /*
> > + * Check if we are running on VMware's hypervisor and bail out
> > + * if we are not.
> > + */
> > + if (x86_hyper != &x86_hyper_vmware)
> > + return -ENODEV;
>
> This symbol is only available when CONFIG_HYPERVISOR_GUEST is defined.
> But this driver does not have a Kconfig dependency on that symbol so
> the build can fail in some configurations.

Hi David,
It looks typically modern Linux distros have CONFIG_HYPERVISOR_GUEST=y
by default, but I agree here we should make the dependency explicit:

--- a/drivers/misc/vmw_vmci/Kconfig
+++ b/drivers/misc/vmw_vmci/Kconfig
@@ -4,7 +4,7 @@

config VMWARE_VMCI
tristate "VMware VMCI Driver"
- depends on X86 && PCI
+ depends on X86 && PCI && HYPERVISOR_GUEST
help
This is VMware's Virtual Machine Communication Interface. It enables
high-speed communication between host and guest in a virtual

And it looks it's not a bad thing to add the dependency, because some
existing VMWare drivers have had the dependency on CONFIG_HYPERVISOR_GUEST=y:
drivers/input/mouse/vmmouse.c (MOUSE_PS2_VMMOUSE)
drivers/misc/vmw_balloon.c (VMWARE_BALLOON)

Do you want me to submit a v2 for this patch with the Kconfig change?

-- Dexuan