Skip to content

Drivers: hv: mshv_vtl: Fix restore partition time ioctl - #169

Open
Naman Jain (namancse) wants to merge 1 commit into
product/hcl-main/6.18from
user/namjain/openhcl-6.18-restore-partition-time-20261127
Open

Naman Jain (namancse) wants to merge 1 commit into
product/hcl-main/6.18from
user/namjain/openhcl-6.18-restore-partition-time-20261127

Conversation

@namancse

Copy link
Copy Markdown
Contributor

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")

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 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_TIME instead of the Linux ioctl number.
  • Removes interrupt disabling around stop_machine() and passes a NULL CPU 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

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.

2 participants