summaryrefslogtreecommitdiffstats
path: root/sys/x86
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-04-02 01:02:42 +0000
committerjhb <jhb@FreeBSD.org>2015-04-02 01:02:42 +0000
commitb09b758bf25e41249b9253a3a796713405f28b4d (patch)
tree7694f537b30d0bb29bc4821549a8b28e4d2fb4b4 /sys/x86
parent5fdf8ec7775f40bbf293206a9670387f9b26b1e2 (diff)
downloadFreeBSD-src-b09b758bf25e41249b9253a3a796713405f28b4d.zip
FreeBSD-src-b09b758bf25e41249b9253a3a796713405f28b4d.tar.gz
MFC 276724:
On some Intel CPUs with a P-state but not C-state invariant TSC the TSC may also halt in C2 and not just C3 (it seems that in some cases the BIOS advertises its C3 state as a C2 state in _CST). Just play it safe and disable both C2 and C3 states if a user forces the use of the TSC as the timecounter on such CPUs. PR: 192316
Diffstat (limited to 'sys/x86')
-rw-r--r--sys/x86/x86/tsc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c
index e96e405..28b61d5 100644
--- a/sys/x86/x86/tsc.c
+++ b/sys/x86/x86/tsc.c
@@ -528,16 +528,16 @@ init_TSC_tc(void)
}
/*
- * We cannot use the TSC if it stops incrementing in deep sleep.
- * Currently only Intel CPUs are known for this problem unless
- * the invariant TSC bit is set.
+ * We cannot use the TSC if it stops incrementing while idle.
+ * Intel CPUs without a C-state invariant TSC can stop the TSC
+ * in either C2 or C3.
*/
- if (cpu_can_deep_sleep && cpu_vendor_id == CPU_VENDOR_INTEL &&
+ if (cpu_deepest_sleep >= 2 && cpu_vendor_id == CPU_VENDOR_INTEL &&
(amd_pminfo & AMDPM_TSC_INVARIANT) == 0) {
tsc_timecounter.tc_quality = -1000;
- tsc_timecounter.tc_flags |= TC_FLAGS_C3STOP;
+ tsc_timecounter.tc_flags |= TC_FLAGS_C2STOP;
if (bootverbose)
- printf("TSC timecounter disabled: C3 enabled.\n");
+ printf("TSC timecounter disabled: C2/C3 may halt it.\n");
goto init;
}
OpenPOWER on IntegriCloud