Repository navigation
Drivers: hv: mshv_vtl: Fix restore partition time ioctl - #169
Open
Naman Jain (namancse) wants to merge 1 commit into
Open
Naman Jain (namancse) wants to merge 1 commit into
Naman Jain (namancse) wants to merge 1 commit into
Conversation
The restore partition time ioctl passes its Linux ioctl number as the Hyper-V hypercall control word. This sends the wrong call code and prevents Hyper-V from restoring the saved clock state. The ioctl also disables interrupts before calling stop_machine(), which can sleep while waiting for the stopper threads. Fix this by using HVCALL_RESTORE_PARTITION_TIME and calling stop_machine() with interrupts enabled. Pass NULL for the CPU mask so the callback runs once on an online CPU with interrupts disabled and the other CPUs stopped. Fixes: 48aafd1 ("drivers: hv: mshv_vtl: Implement restore partition time IOCTL") Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Naman Jain (namancse)
requested review from
Brian Perkins (Brian-Perkins) and
Hardik Garg (hargar19)
and
a balanced review from Copilot
November 27, 2026 07:17
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the Hyper-V partition-time restore ioctl changes.
No open issues 🎉
What changed in this PR
Fixes the Hyper-V partition-time restore ioctl to use the correct hypercall code and avoid calling stop_machine() with interrupts disabled.
Changes:
- Defines and uses
HVCALL_RESTORE_PARTITION_TIMEinstead of the Linux ioctl number. - Removes interrupt disabling around
stop_machine()and passes aNULLCPU mask so the restore callback runs once on an online CPU.
| File | Description |
|---|---|
include/hyperv/hvgdk_mini.h |
Defines the restore-partition-time hypercall code as 0x0103. |
drivers/hv/mshv_vtl_main.c |
Uses the correct hypercall code and fixes the stop_machine() invocation. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The restore partition time ioctl passes its Linux ioctl number as the Hyper-V hypercall control word. This sends the wrong call code and prevents Hyper-V from restoring the saved clock state.
The ioctl also disables interrupts before calling stop_machine(), which can sleep while waiting for the stopper threads.
Fix this by using HVCALL_RESTORE_PARTITION_TIME and calling stop_machine() with interrupts enabled. Pass NULL for the CPU mask so the callback runs once on an online CPU with interrupts disabled and the other CPUs stopped.
Fixes: 48aafd1 ("drivers: hv: mshv_vtl: Implement restore partition time IOCTL")