[PATCH 2/2 v2] x86/tsc: Add additional Intel CPU models to crystal_khz whitelist

From: Prarit Bhargava
Date: Mon Sep 19 2016 - 08:52:20 EST


In commit aa297292d708 ("x86/tsc: Enumerate SKL cpu_khz and tsc_khz via
CPUID"), the kernel added support for Intel processors which had
a different CPU base-frequency and TSC frequency.

The turbostat utility has been updated with KBL and SKX processors,
and they should also be added to the crystal_khz white list.

For example, on INTEL_FAM6_KABYLAKE_MOBILE native_calibrate_tsc() returns 0 MHz
for tsc_khz and after this patch native_calibrate_tsc() returns 1608 MHz.

v2: peterz, fix typo for SKX should be 25000

Signed-off-by: Prarit Bhargava <prarit@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: x86@xxxxxxxxxx
Cc: Rafael Aquini <aquini@xxxxxxxxxx>
Cc: "Peter Zijlstra (Intel)" <peterz@xxxxxxxxxxxxx>
Cc: Andy Lutomirski <luto@xxxxxxxxxx>
Cc: Len Brown <len.brown@xxxxxxxxx>
Cc: lenb@xxxxxxxxxx
---
arch/x86/kernel/tsc.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 2344758ba8a3..cd0c9ece25de 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -689,11 +689,18 @@ unsigned long native_calibrate_tsc(void)
switch (boot_cpu_data.x86_model) {
case INTEL_FAM6_SKYLAKE_MOBILE:
case INTEL_FAM6_SKYLAKE_DESKTOP:
+ case INTEL_FAM6_KABYLAKE_MOBILE:
+ case INTEL_FAM6_KABYLAKE_DESKTOP:
crystal_khz = 24000; /* 24.0 MHz */
break;
+ case INTEL_FAM6_SKYLAKE_X:
+ crystal_khz = 25000; /* 25.0 MHz */
+ break;
case INTEL_FAM6_ATOM_GOLDMONT:
crystal_khz = 19200; /* 19.2 MHz */
break;
+ default:
+ crystal_khz = 0;
}
}

--
1.7.9.3