]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86: Avoid global clock update on setting KVM clock MSR
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sun, 28 Apr 2024 12:27:17 +0000 (13:27 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 2 Aug 2024 14:52:54 +0000 (15:52 +0100)
commite97b5fc9834ecc8ede60b40c0cfd38d041332f91
tree918ef953152854ce1ffe36c057460a7390f7e5ed
parentab3a60ea68feba49c0d6cbd36cda561205c57f1a
KVM: x86: Avoid global clock update on setting KVM clock MSR

Commit 0061d53daf26 ("KVM: x86: limit difference between kvmclock updates")
introduced a KVM_REQ_GLOBAL_CLOCK_UPDATE when one vCPU set up its clock.

This was a workaround for the ever-drifting clocks which were based on the
host's CLOCK_MONOTONIC and thus subject to NTP skew. On booting or resuming
a guest, it just leads to running kvm_guest_time_update() twice for each
vCPU for now good reason.

Just use KVM_REQ_CLOCK_UPDATE on the vCPU itself, and only in the case
where the KVM clock is being set up, not turned off.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
arch/x86/kvm/x86.c