On 4/1/2026 10:27 PM, Michael Kelley wrote:
From: Naman Jain <[email protected]> Sent: Monday, March 16, 2026 
5:13 AM

Generalize Synthetic interrupt source vector (sint) to use
vmbus_interrupt variable instead, which automatically takes care of
architectures where HYPERVISOR_CALLBACK_VECTOR is not present (arm64).

Sashiko AI raised an interesting question about the startup timing --
whether the vmbus_platform_driver_probe() is guaranteed to have
set vmbus_interrupt before the VTL functions below run and use it.
What causes the mshv_vtl.ko module to be loaded, and hence run
mshv_vtl_init()?

There is no race condition here. The init ordering guarantees that
vmbus_interrupt is always set before mshv_vtl_synic_enable_regs()
reads it.

The call chain for setting vmbus_interrupt:

  subsys_initcall(hv_acpi_init)                          [level 4]
    -> platform_driver_register(&vmbus_platform_driver) and so on.


The call chain for reading vmbus_interrupt:

  module_init(mshv_vtl_init)                             [level 6]
    -> hv_vtl_setup_synic()
-> cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, ..., mshv_vtl_alloc_context, ...)
        -> mshv_vtl_alloc_context()
          -> mshv_vtl_synic_enable_regs()
            -> sint.vector = vmbus_interrupt

do_initcalls() processes sections in order 0 through 7, so hv_acpi_init() (level 4) is guaranteed to complete before mshv_vtl_init() (level 6) runs.



Regarding memory leak on cpu offline/online or module load/unload- it is beyond the scope of this series, I will fix it separately.

I may need some more time in addressing comments on rest of the patches. Please bear with me.

Regards,
Naman



Signed-off-by: Roman Kisel <[email protected]>
Signed-off-by: Naman Jain <[email protected]>
---
  drivers/hv/mshv_vtl_main.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hv/mshv_vtl_main.c b/drivers/hv/mshv_vtl_main.c
index b607b6e7e121..91517b45d526 100644
--- a/drivers/hv/mshv_vtl_main.c
+++ b/drivers/hv/mshv_vtl_main.c
@@ -234,7 +234,7 @@ static void mshv_vtl_synic_enable_regs(unsigned int cpu)
        union hv_synic_sint sint;

        sint.as_uint64 = 0;
-       sint.vector = HYPERVISOR_CALLBACK_VECTOR;
+       sint.vector = vmbus_interrupt;
        sint.masked = false;
        sint.auto_eoi = hv_recommend_using_aeoi();

@@ -753,7 +753,7 @@ static void mshv_vtl_synic_mask_vmbus_sint(void *info)
        const u8 *mask = info;

        sint.as_uint64 = 0;
-       sint.vector = HYPERVISOR_CALLBACK_VECTOR;
+       sint.vector = vmbus_interrupt;
        sint.masked = (*mask != 0);
        sint.auto_eoi = hv_recommend_using_aeoi();

--
2.43.0


Assuming there's no timing problem vs. the VMBus driver,

Reviewed-by: Michael Kelley <[email protected]>


Reply via email to