-
Notifications
You must be signed in to change notification settings - Fork 20
drivers: hv: mshv_vtl: Implement restore partition time IOCTL #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: hv: mshv_vtl: Implement restore partition time IOCTL #116
Conversation
There was a problem hiding this 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_TIMEIOCTL and associated data structures in UAPI headers - Implements the IOCTL handler that uses
stop_machineto safely update partition time - Exports
hv_save_sched_clock_stateandhv_restore_sched_clock_statefunctions 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.
There was a problem hiding this 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.
There was a problem hiding this 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.
|
The patch is OK to me for the UH kernel repo. |
hargar19
left a comment
There was a problem hiding this 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.
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.