]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/hyperv: move stimer cleanup to hv_machine_shutdown()
authorJork Loeser <jloeser@linux.microsoft.com>
Wed, 8 Apr 2026 01:36:39 +0000 (18:36 -0700)
committerWei Liu <wei.liu@kernel.org>
Wed, 22 Apr 2026 06:23:25 +0000 (06:23 +0000)
Move hv_stimer_global_cleanup() from vmbus's hv_kexec_handler() to
hv_machine_shutdown() in the platform code. This ensures stimer cleanup
happens before the vmbus unload, which is required for root partition
kexec to work correctly.

Co-developed-by: Anirudh Rayabharam <anrayabh@linux.microsoft.com>
Signed-off-by: Anirudh Rayabharam <anrayabh@linux.microsoft.com>
Signed-off-by: Jork Loeser <jloeser@linux.microsoft.com>
Reviewed-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
arch/x86/kernel/cpu/mshyperv.c
drivers/hv/vmbus_drv.c

index 9befdc557d9e50b7b07a5352172aacc06095f853..c506c7b80f7cb394bfa1c5d67e855ef471a4e3d5 100644 (file)
@@ -235,8 +235,12 @@ void hv_remove_crash_handler(void)
 #ifdef CONFIG_KEXEC_CORE
 static void hv_machine_shutdown(void)
 {
-       if (kexec_in_progress && hv_kexec_handler)
-               hv_kexec_handler();
+       if (kexec_in_progress) {
+               hv_stimer_global_cleanup();
+
+               if (hv_kexec_handler)
+                       hv_kexec_handler();
+       }
 
        /*
         * Call hv_cpu_die() on all the CPUs, otherwise later the hypervisor
index 463eb818549e936197593ed0dcb92e18a4f43dd7..71f1b4d52f7f722442fcac68014831663002ad83 100644 (file)
@@ -2883,7 +2883,6 @@ static struct platform_driver vmbus_platform_driver = {
 
 static void hv_kexec_handler(void)
 {
-       hv_stimer_global_cleanup();
        vmbus_initiate_unload(false);
        /* Make sure conn_state is set as hv_synic_cleanup checks for it */
        mb();