Re: [PATCH v3 1/1] Drivers: hv: vmbus: Skip VMBus module cleanup for non-nested root partition

Wei Liu <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,org.kernel.vger.linux-hyperv
Message-ID <[email protected]>
On Wed, Aug 12, 2026 at 07:52:23AM -0700, Michael Kelley wrote:
> The VMBus module initialization function, hv_acpi_init(), currently
> does nothing when running in the root partition and root is not nested
> in another VM. But the initialization function reports success, so the
> VMBus module is indeed loaded. VMBus functionality is not actually
> needed, but the VMBus module must be loaded so that hv_vmbus_exists()
> can answer correctly. Furthermore, the mshv_root dependency on the
> VMBus module is needed as described in the commit message for
> 840b740a35bf ("mshv: Add conditional VMBus dependency").
> 
> Loading the VMBus module without actually initializing it causes
> failures if the module should later be unloaded. The module unload code
> tries to clean up things that were never initialized, resulting in
> memory faults and a panic.
> 
> Fix this by having VMBus module exit function perform the same
> check for non-nested root partition, and do nothing in such a
> case, just like hv_acpi_init().
> 
> In the long run, the code that manages the Hyper-V provided SynIC
> should be refactored to better coordinate the requirements of
> root partition scenarios and normal VM scenarios, and to hopefully
> remove the hv_vmbus_exists() dependnecy between mshv_root and
> VMBus modules. Preventing the current unload failure scenario is
> an expediency until such a refactoring is done.
> 
> Reported-by: Sashiko <[email protected]>
> Closes: https://lore.kernel.org/linux-hyperv/[email protected]/
> Fixes: 7e279d78664aa ("Drivers: hv: vmbus: skip VMBus initialization if Linux is root")
> Signed-off-by: Michael Kelley <[email protected]>
> Reviewed-by: Easwar Hariharan <[email protected]>

Applied. Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.