Commit 4ca4df0b authored by Bin Gao's avatar Bin Gao Committed by Thomas Gleixner

x86/tsc: Mark TSC frequency determined by CPUID as known

CPUs/SoCs with CPUID leaf 0x15 come with a known frequency and will report
the frequency to software via CPUID instruction. This hardware provided
frequency is the "real" frequency of TSC.

Set the X86_FEATURE_TSC_KNOWN_FREQ flag for such systems to skip the
software calibration process.

A 24 hours test on one of the CPUID 0x15 capable platforms was
conducted. PIT calibrated frequency resulted in more than 3 seconds drift
whereas the CPUID determined frequency showed less than 0.5 second
drift.
Signed-off-by: default avatarBin Gao <bin.gao@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1479241644-234277-3-git-send-email-bin.gao@linux.intel.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 47c95a46
...@@ -702,6 +702,13 @@ unsigned long native_calibrate_tsc(void) ...@@ -702,6 +702,13 @@ unsigned long native_calibrate_tsc(void)
} }
} }
/*
* TSC frequency determined by CPUID is a "hardware reported"
* frequency and is the most accurate one so far we have. This
* is considered a known frequency.
*/
setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
return crystal_khz * ebx_numerator / eax_denominator; return crystal_khz * ebx_numerator / eax_denominator;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment