Skip to content

drivers: hv: mshv_vtl: Implement restore partition time IOCTL#116

Merged
hargar19 merged 6 commits intomicrosoft:product/hcl-main/6.12from
Brian-Perkins:restore_partition_time
Feb 3, 2026
Merged

drivers: hv: mshv_vtl: Implement restore partition time IOCTL#116
hargar19 merged 6 commits intomicrosoft:product/hcl-main/6.12from
Brian-Perkins:restore_partition_time

Conversation

@Brian-Perkins
Copy link
Contributor

Hyper-V supports a restore partition time hypercall that resets the TSC to provided values. This call is typically made by a Windows guest when restoring from hibernate. The paravisor needs to support this call in order to allow the guest to be able to successfully perform the operation. Since the reference time is being changed, clocks need to be updated to maintain consistent foward progress.

Copilot AI review requested due to automatic review settings January 30, 2026 19:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements support for the Hyper-V restore partition time hypercall, which allows Windows guests to restore from hibernate by resetting the TSC to provided values. The implementation adds a new IOCTL that stops all CPUs, makes the hypercall to update the TSC, and updates clock state to maintain forward progress.

Changes:

  • Adds MSHV_RESTORE_PARTITION_TIME IOCTL and associated data structures in UAPI headers
  • Implements the IOCTL handler that uses stop_machine to safely update partition time
  • Exports hv_save_sched_clock_state and hv_restore_sched_clock_state functions for clock state management

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
include/uapi/linux/mshv.h Adds mshv_partition_time struct and MSHV_RESTORE_PARTITION_TIME IOCTL definition
include/uapi/hyperv/hvgdk_mini.h Adds HVCALL_RESTORE_PARTITION_TIME hypercall code and x86-64 specific hv_input_restore_partition_time struct
include/asm-generic/hyperv-tlfs.h Adds HVCALL_RESTORE_PARTITION_TIME hypercall code and hv_input_restore_partition_time struct
drivers/hv/mshv_vtl_main.c Implements the main IOCTL handler and stop_machine callback for restoring partition time
arch/x86/kernel/cpu/mshyperv.c Changes visibility of clock state save/restore functions from static to exported
arch/x86/include/asm/mshyperv.h Adds function declarations for exported clock state functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 2, 2026 18:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 3, 2026 16:08
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dcui
Copy link
Contributor

dcui commented Feb 3, 2026

The patch is OK to me for the UH kernel repo.

@hargar19 hargar19 self-requested a review February 3, 2026 19:22
Copy link
Collaborator

@hargar19 hargar19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR was reviewed by Dexuan. I am approving and merging it since the reviewers do not have the required permissions to merge.

@hargar19 hargar19 merged commit 09712b0 into microsoft:product/hcl-main/6.12 Feb 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants