Skip to content

Commit f7ce370

Browse files
Jork Loeserliuw
authored andcommitted
x86/hyperv: move stimer cleanup to hv_machine_shutdown()
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>
1 parent 3c42b33 commit f7ce370

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

arch/x86/kernel/cpu/mshyperv.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,12 @@ void hv_remove_crash_handler(void)
235235
#ifdef CONFIG_KEXEC_CORE
236236
static void hv_machine_shutdown(void)
237237
{
238-
if (kexec_in_progress && hv_kexec_handler)
239-
hv_kexec_handler();
238+
if (kexec_in_progress) {
239+
hv_stimer_global_cleanup();
240+
241+
if (hv_kexec_handler)
242+
hv_kexec_handler();
243+
}
240244

241245
/*
242246
* Call hv_cpu_die() on all the CPUs, otherwise later the hypervisor

drivers/hv/vmbus_drv.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2883,7 +2883,6 @@ static struct platform_driver vmbus_platform_driver = {
28832883

28842884
static void hv_kexec_handler(void)
28852885
{
2886-
hv_stimer_global_cleanup();
28872886
vmbus_initiate_unload(false);
28882887
/* Make sure conn_state is set as hv_synic_cleanup checks for it */
28892888
mb();

0 commit comments

Comments
 (0)