Re: [PATCH v6 06/51] x86/sev: Don't override CPU frequency calibration for SNP's Secure TSC

David Woodhouse <[email protected]>
Newsgroups org.xenproject.lists.xen-devel,dev.linux.lists.linux-coco,dev.linux.lists.virtualization,org.kernel.vger.kvm,org.kernel.vger.linux-hyperv,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Thu, 2026-08-06 at 16:35 -0700, Sean Christopherson wrote:
> Don't override the kernel's CPU frequency calibration routine when
> registering SNP's Secure TSC calibration routine.  SNP (the architecture)
> provides zero guarantees that the CPU runs at the same frequency as the
> TSC.  The justification for clobbering the CPU routine was:
>
>   Since the difference between CPU base and TSC frequency does not apply
>   in this case, the same callback is being used.
>
> but that's simply not true.  E.g. if APERF/MPERF is exposed to the VM, then
> the CPU frequency absolutely does matter.
>
> While relying on heuristics and/or the untrusted hypervisor to provide the
> CPU frequency isn't ideal, it's at least not outright wrong.
>
> Fixes: 73bbf3b0fbba ("x86/tsc: Init the TSC for Secure TSC guests")
> Cc: Nikunj A Dadhania <[email protected]>
> Cc: Tom Lendacky <[email protected]>
> Reviewed-by: Nikunj A Dadhania <[email protected]>
> Signed-off-by: Sean Christopherson <[email protected]>

Reviewed-by: David Woodhouse <[email protected]>

I don't think I care about Sashiko's complaint. Even if we still clamp
it in generic code, I think that's better than having those in the
platform-specific code.
smime.p7s (application/pkcs7-signature, 6 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.