[PATCH 2/2] x86/tsc: Fix UV TSC initialization

From: Mike Travis
Date: Mon Oct 01 2018 - 21:29:53 EST


Fix regression introduced by

commit cf7a63ef4e02 ("x86/tsc: Calibrate tsc only once")

as it changed setup_arch() so that it now calls tsc_early_init() before
acpi_boot_table_init() which is a necessary step, in the case of UV
systems, to inform tsc_sanitize_first_cpu() that we're on a platform
with async TSC resets as documented in

commit 341102c3ef29 ("x86/tsc: Add option that TSC on Socket 0 being non-zero is valid")

Fix by skipping tsc_early_init() on UV systems and let TSC initialization
take place later in tsc_init().

Fixes: cf7a63ef4e02 ("x86/tsc: Calibrate tsc only once")
Signed-off-by: Mike Travis <mike.travis@xxxxxxx>
Signed-off-by: Hedi Berriche <hedi.berriche@xxxxxxx>
Reviewed-by: Russ Anderson <rja@xxxxxxx>
Reviewed-by: Dimitri Sivanich <sivanich@xxxxxxx>
---
arch/x86/kernel/setup.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

--- linux.orig/arch/x86/kernel/setup.c
+++ linux/arch/x86/kernel/setup.c
@@ -117,6 +117,7 @@
#include <asm/microcode.h>
#include <asm/kaslr.h>
#include <asm/unwind.h>
+#include <asm/uv/uv.h>

/*
* max_low_pfn_mapped: highest direct mapped pfn under 4GB
@@ -1015,7 +1016,10 @@ void __init setup_arch(char **cmdline_p)
*/
init_hypervisor_platform();

- tsc_early_init();
+ /* UV TSC multi-chassis synchronization already set, don't change it */
+ if (!is_early_uv_system())
+ tsc_early_init();
+
x86_init.resources.probe_roms();

/* after parse_early_param, so could debug it */

--