On Thu, 2026-05-21 at 13:53 -0700, Sean Christopherson wrote:
>
> E.g. this is what I've got for the early flow. Testing now.
>
> void __init tsc_early_init(void)
> {
> unsigned int known_cpu_khz = 0, known_tsc_khz = 0;
>
> if (!boot_cpu_has(X86_FEATURE_TSC))
> return;
> /* Don't change UV TSC multi-chassis synchronization */
> if (is_early_uv_system())
> return;
>
> if (x86_init.hyper.get_cpu_khz)
> known_cpu_khz = x86_init.hyper.get_cpu_khz();
>
> if (tsc_early_khz)
> known_tsc_khz = tsc_early_khz;
> else if (cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC))
> known_tsc_khz = snp_secure_tsc_init();
> else if (boot_cpu_has(X86_FEATURE_TDX_GUEST))
> known_tsc_khz = tdx_tsc_init();
>
> /*
> * If the TSC frequency is still unknown, i.e. not provided by the user
> * or by trusted firmware, try to get it from the hypervisor (which is
> * untrusted when running as a CoCo guest).
> */
> if (!known_tsc_khz && x86_init.hyper.get_tsc_khz)
> known_tsc_khz = x86_init.hyper.get_tsc_khz();
>
> if (known_tsc_khz)
> setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
>
> if (!determine_cpu_tsc_frequencies(true, known_cpu_khz, known_tsc_khz))
> return;
> tsc_enable_sched_clock();
> }That seems reasonable. Where does the call to native_calibrate_tsc() happen; is that from determine_cpu_tsc_frequencies()?
smime.p7s
Description: S/MIME cryptographic signature

