]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: x86: Remove per-vCPU "cache" of its reference pvclock
authorSean Christopherson <seanjc@google.com>
Sat, 1 Feb 2025 01:38:25 +0000 (17:38 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 12 Feb 2025 18:45:55 +0000 (10:45 -0800)
commit39d61b46adfd784f601534a6d488697bf53f2633
tree7b690ad38a6c4a06c1aa6dfe78d3278e17ba510d
parent46aed4d4a7db828e0019d16c575e93cc318571db
KVM: x86: Remove per-vCPU "cache" of its reference pvclock

Remove the per-vCPU "cache" of the reference pvclock and instead cache
only the TSC shift+multiplier.  All other fields in pvclock are fully
recomputed by kvm_guest_time_update(), i.e. aren't actually persisted.

In addition to shaving a few bytes, explicitly tracking the TSC shift/mul
fields makes it easier to see that those fields are tied to hw_tsc_khz
(they exist to avoid having to do expensive math in the common case).
And conversely, not tracking the other fields makes it easier to see that
things like the version number are pulled from the guest's copy, not from
KVM's reference.

Reviewed-by: Paul Durrant <paul@xen.org>
Link: https://lore.kernel.org/r/20250201013827.680235-10-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/x86.c
arch/x86/kvm/xen.c