Skip to content

Commit

Permalink
x86/tsc: Fix UV TSC initialization
Browse files Browse the repository at this point in the history
The recent rework of the TSC calibration code introduced a regression on UV
systems as it added a call to tsc_early_init() which initializes the TSC
ADJUST values before acpi_boot_table_init().  In the case of UV systems,
that is a necessary step that calls uv_system_init().  This informs
tsc_sanitize_first_cpu() that the kernel runs on a platform with async TSC
resets as documented in commit 341102c ("x86/tsc: Add option that TSC
on Socket 0 being non-zero is valid")

Fix it by skipping the early tsc initialization on UV systems and let TSC
init tests take place later in tsc_init().

Fixes: cf7a63e ("x86/tsc: Calibrate tsc only once")
Suggested-by: Hedi Berriche <[email protected]>
Signed-off-by: Mike Travis <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Russ Anderson <[email protected]>
Reviewed-by: Dimitri Sivanich <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Dimitri Sivanich <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Kate Stewart <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Philippe Ombredanne <[email protected]>
Cc: Pavel Tatashin <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Dou Liyang <[email protected]>
Cc: Xiaoming Gao <[email protected]>
Cc: Rajvi Jingar <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
  • Loading branch information
mike-travis authored and KAGA-KOKO committed Oct 2, 2018
1 parent 20a8378 commit 2647c43
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/kernel/tsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <asm/apic.h>
#include <asm/intel-family.h>
#include <asm/i8259.h>
#include <asm/uv/uv.h>

unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */
EXPORT_SYMBOL(cpu_khz);
Expand Down Expand Up @@ -1433,6 +1434,9 @@ void __init tsc_early_init(void)
{
if (!boot_cpu_has(X86_FEATURE_TSC))
return;
/* Don't change UV TSC multi-chassis synchronization */
if (is_early_uv_system())
return;
if (!determine_cpu_tsc_frequencies(true))
return;
loops_per_jiffy = get_loops_per_jiffy();
Expand Down

0 comments on commit 2647c43

Please sign in to comment.