git: 281b496f22d1 - main - vmm: fix restore of TSC offset
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 28 Feb 2023 12:38:38 UTC
The branch main has been updated by corvink:
URL: https://cgit.FreeBSD.org/src/commit/?id=281b496f22d1d666b2ef1e54985432627ec434a4
commit 281b496f22d1d666b2ef1e54985432627ec434a4
Author: Vitaliy Gusev <gusev.vitaliy@gmail.com>
AuthorDate: 2023-02-28 11:16:35 +0000
Commit: Corvin Köhne <corvink@FreeBSD.org>
CommitDate: 2023-02-28 12:37:44 +0000
vmm: fix restore of TSC offset
After suspend/resume Ubuntu 20.04 and 22.04 installer can hang if
tsc-early clocksource has a big skew.
Reviewed by: corvink, jhb
Fixes: a7db532e3a6f83067b342f569b56076d011f8a1e ("vmm: Simplify saving of absolute TSC values in snapshots.")
MFC after: 2 weeks
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D38474
---
sys/amd64/vmm/vmm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
index 9f5fc124f4ff..794ec5ab6597 100644
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -2859,6 +2859,8 @@ vm_snapshot_vcpus(struct vm *vm, struct vm_snapshot_meta *meta)
*/
tsc = now + vcpu->tsc_offset;
SNAPSHOT_VAR_OR_LEAVE(tsc, meta, ret, done);
+ if (meta->op == VM_SNAPSHOT_RESTORE)
+ vcpu->tsc_offset = tsc;
}
done: