Re: [PATCH v6 11/51] x86/tsc: Add dedicated hypervisor hooks for getting known TSC/CPU frequencies

David Woodhouse <[email protected]> Sat, 08 Aug 2026 15:55:26 +0100
Newsgroups org.kernel.vger.linux-hyperv,dev.linux.lists.linux-coco,dev.linux.lists.virtualization,org.kernel.vger.kvm,org.kernel.vger.linux-kernel,org.xenproject.lists.xen-devel
Message-ID <[email protected]>
On Thu, 2026-08-06 at 16:35 -0700, Sean Christopherson wrote:
> Add dedicated hypervisor hooks for getting known TSC/CPU frequencies
> instead of overriding seemingly generic platform hooks, and explicitly
> prioritize hypervisor-provided frequencies over native methods, but do NOT
> clobber the frequency obtained from trusted firmware.  While shuffling the
> hooks around is arguably "six of one, half dozen of the other", scoping
> them to x86_hyper_init makes their purpose more obvious, and allows for
> explicitly defining the priority of sources (as is done here).
>
> As is already done when trusted firmware provides the TSC frequency, ignore
> tsc_early_khz if the exact TSC frequency was obtained from the hypervisor,
> as attempting to refine the TSC frequency when running in a VM is all but
> guaranteed to cause problems sooner or later due to the calibration sources
> being emulated devices in the vast majority of setups.
>
> Cc: David Woodhouse <[email protected]>
> Reviewed-by: Michael Kelley <[email protected]>
> Signed-off-by: Sean Christopherson <[email protected]>

Reviewed-by: David Woodhouse <[email protected]>
smime.p7s (application/pkcs7-signature, 6 KB) - not displayed