* RE: [PATCH v3 0/2] hyperv: Run VMBus kexec cleanup from syscore shutdown
2026-10-01 13:21 [PATCH v3 0/2] hyperv: Run VMBus kexec cleanup from syscore shutdown Shradha Gupta
@ 2026-10-01 16:14 ` Michael Kelley
2026-10-06 9:26 ` Shradha Gupta
2026-10-01 16:52 ` Bradley Morgan
2026-10-06 10:08 ` Naman Jain
2 siblings, 1 reply; 5+ messages in thread
From: Michael Kelley @ 2026-10-01 16:14 UTC (permalink / raw)
To: Shradha Gupta, Wei Liu, Catalin Marinas, Baoquan He
Cc: Will Deacon, K . Y . Srinivasan, Haiyang Zhang, Dexuan Cui,
Andrew Morton, Mike Rapoport, Pasha Tatashin, Pratyush Yadav,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
x86@kernel.org, Arnd Bergmann, linux-hyperv@vger.kernel.org,
kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
From: Shradha Gupta <shradhagupta@linux.microsoft.com> Sent: Thursday, October 1, 2026 6:21 AM
>
> Kexec reboot fails on ARM64 Hyper-V guests because the VMBus
> connection and SynIC CPU hotplug state are not torn down before the
> secondary CPUs are stopped. The kexec kernel consequently starts with
> the previous kernel's VMBus state still active.
>
> The previous version added an ARM64-specific syscore shutdown
> implementation. This version follows Michael Kelley's review and moves
> the cleanup into the existing architecture-independent VMBus syscore
> operations. This removes the separate x86 handler dispatch and gives
> x86 and ARM64 the same ordering:
>
> device_shutdown()
> syscore_shutdown()
> VMBus UNLOAD and SynIC CPU hotplug teardown
> machine_shutdown()
>
> On x86, VMBus teardown now runs before hv_stimer_global_cleanup().
> This ordering is safe after commit be0cfab740e5 ("clocksource: hyper-v:
> Remove support for stimer interrupts in message mode") removed the
> VMBus dependency from synthetic timer handling.
>
> Patch 1 adds a read-only helper that reports whether a kexec reboot is
> in progress. The helper is exported because HYPERV_VMBUS is tristate
> and the common syscore callback must also link when VMBus is a module.
> Patch 2 moves the cleanup into the common callback and removes the
> obsolete architecture-specific setup/remove interface.
>
> For stable kernels that still support message-mode stimers, an
> ARM64-specific backport will be needed to preserve the existing x86
> ordering.
>
> Changes in v3:
> - Use the existing common VMBus syscore operations on all
> architectures, as suggested by Michael.
> - Remove the x86 handler pointer and the weak setup/remove interface.
> - Add an exported read-only helper for modular VMBus builds.
> - Correct the Fixes tag to the commit that enabled Hyper-V on ARM64.
>
> Changes in v2:
> - Use syscore shutdown instead of an ARM64 machine_shutdown() hook, as
> suggested by Catalin.
>
> Shradha Gupta (2):
> kexec: Add helper to report an active kexec reboot
> Drivers: hv: Run VMBus kexec cleanup from syscore shutdown
>
> arch/x86/kernel/cpu/mshyperv.c | 17 +----------------
> drivers/hv/hv_common.c | 10 ----------
> drivers/hv/vmbus_drv.c | 22 ++++++++++++++--------
> include/asm-generic/mshyperv.h | 2 --
> include/linux/kexec.h | 2 ++
> kernel/kexec_core.c | 7 +++++++
> 6 files changed, 24 insertions(+), 36 deletions(-)
>
>
> base-commit: be0cfab740e58b70047ef6e7e3d578f00ed5d258
> --
> 2.43.0
Nice! Net impact is to remove 12 lines of code, instead of
adding 40, which is great. And nothing under arch/arm64 is
modified.
One minor point: In hv_machine_shutdown(), we have two
sequential tests of kexec_in_progress. Given that you are
removing some code under the first test, I think it would be
fair game to do a very minor refactoring of existing code and
combine the two tests. It just looks a little funny to have the
same test twice in a row.
But regardless of whether you include that change, for
the series,
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v3 0/2] hyperv: Run VMBus kexec cleanup from syscore shutdown
2026-10-01 16:14 ` Michael Kelley
@ 2026-10-06 9:26 ` Shradha Gupta
0 siblings, 0 replies; 5+ messages in thread
From: Shradha Gupta @ 2026-10-06 9:26 UTC (permalink / raw)
To: Michael Kelley
Cc: Wei Liu, Catalin Marinas, Baoquan He, Will Deacon,
K . Y . Srinivasan, Haiyang Zhang, Dexuan Cui, Andrew Morton,
Mike Rapoport, Pasha Tatashin, Pratyush Yadav, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, Dave Hansen, x86@kernel.org,
Arnd Bergmann, linux-hyperv@vger.kernel.org,
kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
On Thu, Oct 01, 2026 at 04:14:22PM +0000, Michael Kelley wrote:
> From: Shradha Gupta <shradhagupta@linux.microsoft.com> Sent: Thursday, October 1, 2026 6:21 AM
> >
> > Kexec reboot fails on ARM64 Hyper-V guests because the VMBus
> > connection and SynIC CPU hotplug state are not torn down before the
> > secondary CPUs are stopped. The kexec kernel consequently starts with
> > the previous kernel's VMBus state still active.
> >
> > The previous version added an ARM64-specific syscore shutdown
> > implementation. This version follows Michael Kelley's review and moves
> > the cleanup into the existing architecture-independent VMBus syscore
> > operations. This removes the separate x86 handler dispatch and gives
> > x86 and ARM64 the same ordering:
> >
> > device_shutdown()
> > syscore_shutdown()
> > VMBus UNLOAD and SynIC CPU hotplug teardown
> > machine_shutdown()
> >
> > On x86, VMBus teardown now runs before hv_stimer_global_cleanup().
> > This ordering is safe after commit be0cfab740e5 ("clocksource: hyper-v:
> > Remove support for stimer interrupts in message mode") removed the
> > VMBus dependency from synthetic timer handling.
> >
> > Patch 1 adds a read-only helper that reports whether a kexec reboot is
> > in progress. The helper is exported because HYPERV_VMBUS is tristate
> > and the common syscore callback must also link when VMBus is a module.
> > Patch 2 moves the cleanup into the common callback and removes the
> > obsolete architecture-specific setup/remove interface.
> >
> > For stable kernels that still support message-mode stimers, an
> > ARM64-specific backport will be needed to preserve the existing x86
> > ordering.
> >
> > Changes in v3:
> > - Use the existing common VMBus syscore operations on all
> > architectures, as suggested by Michael.
> > - Remove the x86 handler pointer and the weak setup/remove interface.
> > - Add an exported read-only helper for modular VMBus builds.
> > - Correct the Fixes tag to the commit that enabled Hyper-V on ARM64.
> >
> > Changes in v2:
> > - Use syscore shutdown instead of an ARM64 machine_shutdown() hook, as
> > suggested by Catalin.
> >
> > Shradha Gupta (2):
> > kexec: Add helper to report an active kexec reboot
> > Drivers: hv: Run VMBus kexec cleanup from syscore shutdown
> >
> > arch/x86/kernel/cpu/mshyperv.c | 17 +----------------
> > drivers/hv/hv_common.c | 10 ----------
> > drivers/hv/vmbus_drv.c | 22 ++++++++++++++--------
> > include/asm-generic/mshyperv.h | 2 --
> > include/linux/kexec.h | 2 ++
> > kernel/kexec_core.c | 7 +++++++
> > 6 files changed, 24 insertions(+), 36 deletions(-)
> >
> >
> > base-commit: be0cfab740e58b70047ef6e7e3d578f00ed5d258
> > --
> > 2.43.0
>
> Nice! Net impact is to remove 12 lines of code, instead of
> adding 40, which is great. And nothing under arch/arm64 is
> modified.
>
> One minor point: In hv_machine_shutdown(), we have two
> sequential tests of kexec_in_progress. Given that you are
> removing some code under the first test, I think it would be
> fair game to do a very minor refactoring of existing code and
> combine the two tests. It just looks a little funny to have the
> same test twice in a row.
>
> But regardless of whether you include that change, for
> the series,
>
> Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Thank you Michael, I'll take up the refactoring in a seperate patch.
regards,
Shradha
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 0/2] hyperv: Run VMBus kexec cleanup from syscore shutdown
2026-10-01 13:21 [PATCH v3 0/2] hyperv: Run VMBus kexec cleanup from syscore shutdown Shradha Gupta
2026-10-01 16:14 ` Michael Kelley
@ 2026-10-01 16:52 ` Bradley Morgan
2026-10-06 10:08 ` Naman Jain
2 siblings, 0 replies; 5+ messages in thread
From: Bradley Morgan @ 2026-10-01 16:52 UTC (permalink / raw)
To: shradhagupta
Cc: akpm, arnd, baoquan.he, bp, catalin.marinas, dave.hansen, decui,
haiyangz, kexec, kys, linux-arch, linux-arm-kernel, linux-hyperv,
linux-kernel, longli, mhklinux, mingo, pasha.tatashin, pratyush,
rppt, tglx, wei.liu, will, x86
On 1 October 2026 14:21:25 BST, Shradha Gupta
<shradhagupta@linux.microsoft.com> wrote:
>Kexec reboot fails on ARM64 Hyper-V guests because the VMBus
>connection and SynIC CPU hotplug state are not torn down before the
>secondary CPUs are stopped. The kexec kernel consequently starts with
>the previous kernel's VMBus state still active.
>
>The previous version added an ARM64-specific syscore shutdown
>implementation. This version follows Michael Kelley's review and moves
>the cleanup into the existing architecture-independent VMBus syscore
>operations. This removes the separate x86 handler dispatch and gives
>x86 and ARM64 the same ordering:
>
> device_shutdown()
> syscore_shutdown()
> VMBus UNLOAD and SynIC CPU hotplug teardown
> machine_shutdown()
>
>On x86, VMBus teardown now runs before hv_stimer_global_cleanup().
>This ordering is safe after commit be0cfab740e5 ("clocksource: hyper-v:
>Remove support for stimer interrupts in message mode") removed the
>VMBus dependency from synthetic timer handling.
>
>Patch 1 adds a read-only helper that reports whether a kexec reboot is
>in progress. The helper is exported because HYPERV_VMBUS is tristate
>and the common syscore callback must also link when VMBus is a module.
>Patch 2 moves the cleanup into the common callback and removes the
>obsolete architecture-specific setup/remove interface.
>
>For stable kernels that still support message-mode stimers, an
>ARM64-specific backport will be needed to preserve the existing x86
>ordering.
>
>Changes in v3:
> - Use the existing common VMBus syscore operations on all
> architectures, as suggested by Michael.
> - Remove the x86 handler pointer and the weak setup/remove interface.
> - Add an exported read-only helper for modular VMBus builds.
> - Correct the Fixes tag to the commit that enabled Hyper-V on ARM64.
>
>Changes in v2:
> - Use syscore shutdown instead of an ARM64 machine_shutdown() hook, as
> suggested by Catalin.
>
>Shradha Gupta (2):
> kexec: Add helper to report an active kexec reboot
> Drivers: hv: Run VMBus kexec cleanup from syscore shutdown
>
> arch/x86/kernel/cpu/mshyperv.c | 17 +----------------
> drivers/hv/hv_common.c | 10 ----------
> drivers/hv/vmbus_drv.c | 22 ++++++++++++++--------
> include/asm-generic/mshyperv.h | 2 --
> include/linux/kexec.h | 2 ++
> kernel/kexec_core.c | 7 +++++++
> 6 files changed, 24 insertions(+), 36 deletions(-)
>
>
>base-commit: be0cfab740e58b70047ef6e7e3d578f00ed5d258
>
Wow! Great!!!
Whole series:
Reviewed-by: Bradley Morgan <brads@mainlining.org>
--- Thanks!
"I'm not a very positive person" - Linus torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v3 0/2] hyperv: Run VMBus kexec cleanup from syscore shutdown
2026-10-01 13:21 [PATCH v3 0/2] hyperv: Run VMBus kexec cleanup from syscore shutdown Shradha Gupta
2026-10-01 16:14 ` Michael Kelley
2026-10-01 16:52 ` Bradley Morgan
@ 2026-10-06 10:08 ` Naman Jain
2 siblings, 0 replies; 5+ messages in thread
From: Naman Jain @ 2026-10-06 10:08 UTC (permalink / raw)
To: Shradha Gupta, Michael Kelley, Wei Liu, Catalin Marinas,
Baoquan He
Cc: Will Deacon, K . Y . Srinivasan, Haiyang Zhang, Dexuan Cui,
Long Li, Andrew Morton, Mike Rapoport, Pasha Tatashin,
Pratyush Yadav, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, x86, Arnd Bergmann, linux-hyperv, kexec,
linux-arm-kernel, linux-kernel, linux-arch
On 10/1/2026 6:51 PM, Shradha Gupta wrote:
> Kexec reboot fails on ARM64 Hyper-V guests because the VMBus
> connection and SynIC CPU hotplug state are not torn down before the
> secondary CPUs are stopped. The kexec kernel consequently starts with
> the previous kernel's VMBus state still active.
>
> The previous version added an ARM64-specific syscore shutdown
> implementation. This version follows Michael Kelley's review and moves
> the cleanup into the existing architecture-independent VMBus syscore
> operations. This removes the separate x86 handler dispatch and gives
> x86 and ARM64 the same ordering:
>
> device_shutdown()
> syscore_shutdown()
> VMBus UNLOAD and SynIC CPU hotplug teardown
> machine_shutdown()
>
> On x86, VMBus teardown now runs before hv_stimer_global_cleanup().
> This ordering is safe after commit be0cfab740e5 ("clocksource: hyper-v:
> Remove support for stimer interrupts in message mode") removed the
> VMBus dependency from synthetic timer handling.
>
> Patch 1 adds a read-only helper that reports whether a kexec reboot is
> in progress. The helper is exported because HYPERV_VMBUS is tristate
> and the common syscore callback must also link when VMBus is a module.
> Patch 2 moves the cleanup into the common callback and removes the
> obsolete architecture-specific setup/remove interface.
>
> For stable kernels that still support message-mode stimers, an
> ARM64-specific backport will be needed to preserve the existing x86
> ordering.
>
> Changes in v3:
> - Use the existing common VMBus syscore operations on all
> architectures, as suggested by Michael.
> - Remove the x86 handler pointer and the weak setup/remove interface.
> - Add an exported read-only helper for modular VMBus builds.
> - Correct the Fixes tag to the commit that enabled Hyper-V on ARM64.
>
> Changes in v2:
> - Use syscore shutdown instead of an ARM64 machine_shutdown() hook, as
> suggested by Catalin.
>
> Shradha Gupta (2):
> kexec: Add helper to report an active kexec reboot
> Drivers: hv: Run VMBus kexec cleanup from syscore shutdown
>
> arch/x86/kernel/cpu/mshyperv.c | 17 +----------------
> drivers/hv/hv_common.c | 10 ----------
> drivers/hv/vmbus_drv.c | 22 ++++++++++++++--------
> include/asm-generic/mshyperv.h | 2 --
> include/linux/kexec.h | 2 ++
> kernel/kexec_core.c | 7 +++++++
> 6 files changed, 24 insertions(+), 36 deletions(-)
>
>
> base-commit: be0cfab740e58b70047ef6e7e3d578f00ed5d258
Since the approach changed in this version and previously reviewed-by
tags were not applicable, sharing them again for the series.
Reviewed-by: Naman Jain <namjain@linux.microsoft.com>
Regards,
Naman
^ permalink raw reply [flat|nested] 5+ messages in thread