Re: [PATCH 1/1] mshv: Add conditional VMBus dependency

From: Arnd Bergmann

Date: Thu May 21 2026 - 16:17:43 EST


On Thu, May 21, 2026, at 18:49, Michael Kelley wrote:
>
> Existing code ensures that the VMBus driver loads first if it is
> built-in. The VMBus driver uses subsys_initcall(), which is
> initcall level 4. The MSHV root driver uses module_init(), which
> becomes device_init() when built-in, and device_init() is
> initcall level 6.
>
> Reported-by: Arnd Bergmann <arnd@xxxxxxxx>
> Closes: https://lore.kernel.org/all/20260520074044.923728-1-arnd@xxxxxxxxxx/
> Signed-off-by: Michael Kelley <mhklinux@xxxxxxxxxxx>

Looks good to me, thanks for fixing it!

Acked-by: Arnd Bergmann <arnd@xxxxxxxx>

> /*
> * VMBus owns SIMP/SIEFP/SCONTROL when it is active.
> * See hv_hyp_synic_enable_regs() for that initialization.
> */
> - bool vmbus_active = hv_vmbus_exists();
> +#if IS_ENABLED(CONFIG_HYPERV_VMBUS)
> + vmbus_active = hv_vmbus_exists();
> +#endif

I would usually write this as

if (IS_ENABLED(CONFIG_HYPERV_VMBUS))
vmbus_active = hv_vmbus_exists();

for readability, since the hv_vmbus_exists() declarations is still
visible and the IS_ENABLED() check avoids the link failure.

ARnd