vmm: restore KVM clock before resuming vCPUs - #7932
Conversation
phip1611
left a comment
There was a problem hiding this comment.
Thanks! Let me run this through our pipeline.
LGTM but I want to make sure it's working reliably
c2af4bd to
c2324b3
Compare
phip1611
left a comment
There was a problem hiding this comment.
LGTM! Please address the remaining remarks
|
Please check our contribution guidelines (CONTRIBUTING.md). Your commit message should be no longer than 72 chars. Please wrap it! |
c2324b3 to
477d212
Compare
|
@phip1611 thanks for your commnets, first time contribute to this hh, already wrap the commit logs and remove the empty line |
477d212 to
4f39cdb
Compare
|
We think we've seen this bug also in production - nice find! |
Reorder resume() to: set_clock, device_manager.resume, cpu_manager.resume. This matches the inverse of pause() which correctly saves the clock before pausing vCPUs. Signed-off-by: CMGS <[email protected]>
4f39cdb to
62bac4c
Compare
rbradford
left a comment
There was a problem hiding this comment.
Cool, thanks! - i've also been investigating clock issues after a pause/resume. Not sure if this is the same issue but the fix lgtm!
Backport [0]. Reorder resume() to: set_clock, device_manager.resume, cpu_manager.resume. This matches the inverse of pause() which correctly saves the clock before pausing vCPUs. [0] cloud-hypervisor#7932 Signed-off-by: CMGS <[email protected]>
Backport [0]. Reorder resume() to: set_clock, device_manager.resume, cpu_manager.resume. This matches the inverse of pause() which correctly saves the clock before pausing vCPUs. [0] cloud-hypervisor#7932 Signed-off-by: CMGS <[email protected]>
Since we backported the resume ordering from upstream PR cloud-hypervisor#7932 in cyberus PR cloud-hypervisor#133, virtio devices resume before vCPUs. Some devices need follow-up work that may notify the guest and must therefore wait until vCPUs are running again. We add a post-vCPU-resume virtio callback and invoke it after CpuManager::resume() completes. This callback will be used in a follow-up commit which drains the virtio-blk queue once the vCPUs are resumed after a restore. Ref: cloud-hypervisor#7932 Ref: cyberus-technology#133 On-behalf-of: SAP [email protected] Signed-off-by: Leander Kohler <[email protected]>
Since we backported the resume ordering from upstream PR cloud-hypervisor#7932 in cyberus PR #133, virtio devices resume before vCPUs. Some devices need follow-up work that may notify the guest and must therefore wait until vCPUs are running again. We add a post-vCPU-resume virtio callback and invoke it after CpuManager::resume() completes. This callback will be used in a follow-up commit which drains the virtio-blk queue once the vCPUs are resumed after a restore. Ref: cloud-hypervisor#7932 Ref: #133 On-behalf-of: SAP [email protected] Signed-off-by: Leander Kohler <[email protected]>
The resume() method previously started vCPUs before calling KVM_SET_CLOCK, causing guests to execute with stale clock parameters. This is particularly problematic for Windows/Hyper-V guests where the TSC reference page contains outdated scale/offset values, leading to ~4 minute hangs after vm.restore.
Reorder resume() to: set_clock → device_manager.resume → cpu_manager.resume. This matches the inverse of pause() which correctly saves the clock before pausing vCPUs.
close #7930