[tip: x86/platform] x86/platform/uv: Update TSC sync state for UV5

From: tip-bot2 for Mike Travis
Date: Mon Apr 04 2022 - 18:00:47 EST


The following commit has been merged into the x86/platform branch of tip:

Commit-ID: 4395de040d24b40fb3cd7fb4f0b013748abe0a72
Gitweb: https://git.kernel.org/tip/4395de040d24b40fb3cd7fb4f0b013748abe0a72
Author: Mike Travis <mike.travis@xxxxxxx>
AuthorDate: Fri, 18 Mar 2022 17:43:03 -05:00
Committer: Borislav Petkov <bp@xxxxxxx>
CommitterDate: Mon, 04 Apr 2022 20:21:44 +02:00

x86/platform/uv: Update TSC sync state for UV5

Update TSC to not check TSC sync state for uv5+ as it is not available.
It is assumed that TSC will always be in sync for multiple chassis and
will pass the tests for the kernel to accept it as the clocksource.
To disable this check use the kernel start options tsc=reliable
clocksource=tsc.

Signed-off-by: Mike Travis <mike.travis@xxxxxxx>
Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Reviewed-by: Dimitri Sivanich <dimitri.sivanich@xxxxxxx>
Reviewed-by: Steve Wahl <steve.wahl@xxxxxxx>
Link: https://lore.kernel.org/r/20220318224304.174967-3-mike.travis@xxxxxxx
---
arch/x86/kernel/apic/x2apic_uv_x.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index f5a48e6..387d653 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -199,10 +199,16 @@ static void __init uv_tsc_check_sync(void)
int mmr_shift;
char *state;

- /* Different returns from different UV BIOS versions */
+ /* UV5+, sync state from bios not available, assumed valid */
+ if (!is_uv(UV2|UV3|UV4)) {
+ pr_debug("UV: TSC sync state for UV5+ assumed valid\n");
+ mark_tsc_async_resets("UV5+");
+ return;
+ }
+
+ /* UV2,3,4, UV BIOS TSC sync state available */
mmr = uv_early_read_mmr(UVH_TSC_SYNC_MMR);
- mmr_shift =
- is_uv2_hub() ? UVH_TSC_SYNC_SHIFT_UV2K : UVH_TSC_SYNC_SHIFT;
+ mmr_shift = is_uv2_hub() ? UVH_TSC_SYNC_SHIFT_UV2K : UVH_TSC_SYNC_SHIFT;
sync_state = (mmr >> mmr_shift) & UVH_TSC_SYNC_MASK;

/* Check if TSC is valid for all sockets */