Re: [RFC] x86, tsc: Add kcmdline args for skipping tsc calibration sequences

From: patrickg
Date: Tue Jul 24 2018 - 15:45:28 EST


K, did significant poking.

native_calibrate_cpu is getting precidence no matter what because on SKL server, native_calibrate_tsc is always returning zero (Note that there is a caveat 2 lines down).

In native_calibrate_tsc, I'm seeing it always return zero after the `switch (boot_cpu_data.x86_model)`. crystal_khz is zero so it rolls through that, never assigns it.

Now I'm apparently not testing on production CPU's. I've requested that they drop em' in so I can ensure `CPUID 15H TSC/Crystal ratio` doesn't differ between the ES and Prod silicon, since that will effect the math

Anyways, Then after calibrate is found to be zero, it's utilizing the CPUID calculation from native_calibrate_cpu for tsc_khz since that's returning a 'proper' value when it does the reassignment:

---
if (tsc_khz == 0) /* Hits here and reassigns tsc_khz to the cpuid calculation. */
tsc_khz = cpu_khz;
else if (abs(cpu_khz - tsc_khz) * 10 > tsc_khz)
cpu_khz = tsc_khz;
---

I'll post another update when I've checked with Prod CPU's, /probably/ tomorrow.