[PATCH v3 0/2] hyperv: Run VMBus kexec cleanup from syscore shutdown

Shradha Gupta shradhagupta at linux.microsoft.com
Tue Oct 6 02:26:39 PDT 2026


On Thu, Oct 01, 2026 at 04:14:22PM +0000, Michael Kelley wrote:
> From: Shradha Gupta <shradhagupta at 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 at outlook.com>

Thank you Michael, I'll take up the refactoring in a seperate patch.

regards,
Shradha



More information about the kexec mailing list