From: Arnd Bergmann <[email protected]> Sent: Wednesday, May 20, 2026 12:40 AM
> 
> When the vmbus driver is not part of the kernel, the mvhv_root
> driver now fails to link:
> 
> ERROR: modpost: "hv_vmbus_exists" [drivers/hv/mshv_root.ko] undefined!
> 
> Avoid this by adding an explicit Kconfig dependency. Note that
> stubbing out the hv_vmbus_exists() based on configuration would
> also work for some cases, but not with MSHV_ROOT=y and HYPERV_VMBUS=m.

Conceptually, the MSHV root code should not have a dependency on
VMBus. The "does VMBus exist?" question should handled differently
by setting up a boolean in the core Hyper-V code that defaults to "false".
If the VMBus driver loads, it would set the boolean to "true". MSHV
root code would query the boolean.

Michael

> 
> Fixes: f1a9e67c1138 ("mshv: limit SynIC management to MSHV-owned resources")
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
>  drivers/hv/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
> index 52af086fdeb2..21193b571a80 100644
> --- a/drivers/hv/Kconfig
> +++ b/drivers/hv/Kconfig
> @@ -75,6 +75,7 @@ config MSHV_ROOT
>       # e.g. When withdrawing memory, the hypervisor gives back 4k pages in
>       # no particular order, making it impossible to reassemble larger pages
>       depends on PAGE_SIZE_4KB
> +     depends on HYPERV_VMBUS
>       select EVENTFD
>       select VIRT_XFER_TO_GUEST_WORK
>       select HMM_MIRROR
> --
> 2.39.5
> 


Reply via email to