[PATCH v7 0/4] Add support for clean shutdown with MSHV

Praveen K Paladugu posted 4 patches 1 week, 3 days ago
arch/x86/hyperv/hv_init.c       |  1 +
arch/x86/include/asm/mshyperv.h |  2 +
arch/x86/kernel/cpu/mshyperv.c  |  2 +
drivers/hv/Makefile             |  2 +-
drivers/hv/mshv_common.c        | 99 +++++++++++++++++++++++++++++++++
include/hyperv/hvgdk_mini.h     |  4 +-
include/hyperv/hvhdk_mini.h     | 40 +++++++++++++
7 files changed, 148 insertions(+), 2 deletions(-)
[PATCH v7 0/4] Add support for clean shutdown with MSHV
Posted by Praveen K Paladugu 1 week, 3 days ago
Add support for clean shutdown of the root partition when running on
MSHV Hypervisor.

v7:
 - Fix Makefile condition for building mshv_common.c
 - Drop the now unnecessary CONFIG_X86_64 guards

v6:
 - Fixed build errors, by adding CONFIG_X86_64 guard
 - Moved machine_ops hook definition to ms_hyperv_init_platform
 - Addressed review comments in v5

v5:
 - Fixed build errors
 - Padded struct hv_input_set_system_property for alignment
 - Dropped CONFIG_ACPI stub

v4:
 - Adopted machine_ops to order invoking HV_ENTER_SLEEP_STATE as the
   last step in shutdown sequence.
 - This ensures rest of the cleanups are done before powering off

v3:
 - Dropped acpi_sleep handlers as they are not used on mshv
 - Applied ordering for hv_reboot_notifier
 - Fixed build issues on i386, arm64 architectures

v2:
  - Addressed review comments from v1.
  - Moved all sleep state handling methods under CONFIG_ACPI stub
  - - This fixes build issues on non-x86 architectures.

Praveen K Paladugu (4):
  fixup! Drivers: hv: Introduce mshv_vtl driver
  hyperv: Add definitions for MSHV sleep state configuration
  hyperv: Use reboot notifier to configure sleep state
  hyperv: Cleanly shutdown root partition with MSHV

 arch/x86/hyperv/hv_init.c       |  1 +
 arch/x86/include/asm/mshyperv.h |  2 +
 arch/x86/kernel/cpu/mshyperv.c  |  2 +
 drivers/hv/Makefile             |  2 +-
 drivers/hv/mshv_common.c        | 99 +++++++++++++++++++++++++++++++++
 include/hyperv/hvgdk_mini.h     |  4 +-
 include/hyperv/hvhdk_mini.h     | 40 +++++++++++++
 7 files changed, 148 insertions(+), 2 deletions(-)

-- 
2.51.0
Re: [PATCH v7 0/4] Add support for clean shutdown with MSHV
Posted by Nathan Chancellor 5 days, 14 hours ago
Hi Praveen,

On Fri, Dec 05, 2025 at 02:17:04PM -0600, Praveen K Paladugu wrote:
...
>   hyperv: Use reboot notifier to configure sleep state
>   hyperv: Cleanly shutdown root partition with MSHV

These two patches result in warnings (that get upgraded to errors with
CONFIG_WERROR=y / W=e) on arm64:

  $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux- clean defconfig

  $ scripts/config -e HYPERV -e MSHV_ROOT

  $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux- olddefconfig drivers/hv/mshv_common.o
  drivers/hv/mshv_common.c:210:6: warning: no previous prototype for 'hv_sleep_notifiers_register' [-Wmissing-prototypes]
    210 | void hv_sleep_notifiers_register(void)
        |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  drivers/hv/mshv_common.c:224:6: warning: no previous prototype for 'hv_machine_power_off' [-Wmissing-prototypes]
    224 | void hv_machine_power_off(void)
        |      ^~~~~~~~~~~~~~~~~~~~

The prototypes for these functions are only available for x86.

Cheers,
Nathan
Re: [PATCH v7 0/4] Add support for clean shutdown with MSHV
Posted by Wei Liu 1 week, 2 days ago
On Fri, Dec 05, 2025 at 02:17:04PM -0600, Praveen K Paladugu wrote:
> Add support for clean shutdown of the root partition when running on
> MSHV Hypervisor.
> 
> Praveen K Paladugu (4):
[...]
>   hyperv: Add definitions for MSHV sleep state configuration
>   hyperv: Use reboot notifier to configure sleep state
>   hyperv: Cleanly shutdown root partition with MSHV

I queued these patches to hyperv-next.

Wei