Skip to content

Commit 6a7cf55

Browse files
mike-travissuryasaimadhu
authored andcommitted
x86/platform/uv: Update UV5 TSC checking
Update check of BIOS TSC sync status to include both possible "invalid" states provided by newer UV5 BIOS. Signed-off-by: Mike Travis <mike.travis@hpe.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Steve Wahl <steve.wahl@hpe.com> Link: https://lkml.kernel.org/r/20201005203929.148656-12-mike.travis@hpe.com
1 parent d6922ef commit 6a7cf55

2 files changed

Lines changed: 11 additions & 15 deletions

File tree

arch/x86/include/asm/uv/uv_hub.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ extern void uv_nmi_setup_hubless(void);
726726
#define UVH_TSC_SYNC_SHIFT_UV2K 16 /* UV2/3k have different bits */
727727
#define UVH_TSC_SYNC_MASK 3 /* 0011 */
728728
#define UVH_TSC_SYNC_VALID 3 /* 0011 */
729-
#define UVH_TSC_SYNC_INVALID 2 /* 0010 */
729+
#define UVH_TSC_SYNC_UNKNOWN 0 /* 0000 */
730730

731731
/* BMC sets a bit this MMR non-zero before sending an NMI */
732732
#define UVH_NMI_MMR UVH_BIOS_KERNEL_MMR

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -197,36 +197,32 @@ static void __init uv_tsc_check_sync(void)
197197
int sync_state;
198198
int mmr_shift;
199199
char *state;
200-
bool valid;
201200

202-
/* Accommodate different UV arch BIOSes */
201+
/* Different returns from different UV BIOS versions */
203202
mmr = uv_early_read_mmr(UVH_TSC_SYNC_MMR);
204203
mmr_shift =
205204
is_uv2_hub() ? UVH_TSC_SYNC_SHIFT_UV2K : UVH_TSC_SYNC_SHIFT;
206205
sync_state = (mmr >> mmr_shift) & UVH_TSC_SYNC_MASK;
207206

207+
/* Check if TSC is valid for all sockets */
208208
switch (sync_state) {
209209
case UVH_TSC_SYNC_VALID:
210210
state = "in sync";
211-
valid = true;
211+
mark_tsc_async_resets("UV BIOS");
212212
break;
213213

214-
case UVH_TSC_SYNC_INVALID:
215-
state = "unstable";
216-
valid = false;
214+
/* If BIOS state unknown, don't do anything */
215+
case UVH_TSC_SYNC_UNKNOWN:
216+
state = "unknown";
217217
break;
218+
219+
/* Otherwise, BIOS indicates problem with TSC */
218220
default:
219-
state = "unknown: assuming valid";
220-
valid = true;
221+
state = "unstable";
222+
mark_tsc_unstable("UV BIOS");
221223
break;
222224
}
223225
pr_info("UV: TSC sync state from BIOS:0%d(%s)\n", sync_state, state);
224-
225-
/* Mark flag that says TSC != 0 is valid for socket 0 */
226-
if (valid)
227-
mark_tsc_async_resets("UV BIOS");
228-
else
229-
mark_tsc_unstable("UV BIOS");
230226
}
231227

232228
/* Selector for (4|4A|5) structs */

0 commit comments

Comments
 (0)