Skip to content

Commit 1abcb10

Browse files
committed
Merge tag 'x86_platform_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 platform updates from Borislav Petkov: - A couple of changes enabling SGI UV5 support * tag 'x86_platform_for_v5.19_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/platform/uv: Log gap hole end size x86/platform/uv: Update TSC sync state for UV5 x86/platform/uv: Update NMI Handler for UV5
2 parents c415b53 + 327c348 commit 1abcb10

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,13 @@ static void __init uv_tsc_check_sync(void)
199199
int mmr_shift;
200200
char *state;
201201

202-
/* Different returns from different UV BIOS versions */
202+
/* UV5 guarantees synced TSCs; do not zero TSC_ADJUST */
203+
if (!is_uv(UV2|UV3|UV4)) {
204+
mark_tsc_async_resets("UV5+");
205+
return;
206+
}
207+
208+
/* UV2,3,4, UV BIOS TSC sync state available */
203209
mmr = uv_early_read_mmr(UVH_TSC_SYNC_MMR);
204210
mmr_shift =
205211
is_uv2_hub() ? UVH_TSC_SYNC_SHIFT_UV2K : UVH_TSC_SYNC_SHIFT;
@@ -1340,7 +1346,7 @@ static void __init decode_gam_params(unsigned long ptr)
13401346
static void __init decode_gam_rng_tbl(unsigned long ptr)
13411347
{
13421348
struct uv_gam_range_entry *gre = (struct uv_gam_range_entry *)ptr;
1343-
unsigned long lgre = 0;
1349+
unsigned long lgre = 0, gend = 0;
13441350
int index = 0;
13451351
int sock_min = 999999, pnode_min = 99999;
13461352
int sock_max = -1, pnode_max = -1;
@@ -1374,6 +1380,9 @@ static void __init decode_gam_rng_tbl(unsigned long ptr)
13741380
flag, size, suffix[order],
13751381
gre->type, gre->nasid, gre->sockid, gre->pnode);
13761382

1383+
if (gre->type == UV_GAM_RANGE_TYPE_HOLE)
1384+
gend = (unsigned long)gre->limit << UV_GAM_RANGE_SHFT;
1385+
13771386
/* update to next range start */
13781387
lgre = gre->limit;
13791388
if (sock_min > gre->sockid)
@@ -1391,7 +1400,8 @@ static void __init decode_gam_rng_tbl(unsigned long ptr)
13911400
_max_pnode = pnode_max;
13921401
_gr_table_len = index;
13931402

1394-
pr_info("UV: GRT: %d entries, sockets(min:%x,max:%x) pnodes(min:%x,max:%x)\n", index, _min_socket, _max_socket, _min_pnode, _max_pnode);
1403+
pr_info("UV: GRT: %d entries, sockets(min:%x,max:%x), pnodes(min:%x,max:%x), gap_end(%d)\n",
1404+
index, _min_socket, _max_socket, _min_pnode, _max_pnode, fls64(gend));
13951405
}
13961406

13971407
/* Walk through UVsystab decoding the fields */

arch/x86/platform/uv/uv_nmi.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,10 @@ static inline bool uv_nmi_action_is(const char *action)
244244
/* Setup which NMI support is present in system */
245245
static void uv_nmi_setup_mmrs(void)
246246
{
247+
bool new_nmi_method_only = false;
248+
247249
/* First determine arch specific MMRs to handshake with BIOS */
248-
if (UVH_EVENT_OCCURRED0_EXTIO_INT0_MASK) {
250+
if (UVH_EVENT_OCCURRED0_EXTIO_INT0_MASK) { /* UV2,3,4 setup */
249251
uvh_nmi_mmrx = UVH_EVENT_OCCURRED0;
250252
uvh_nmi_mmrx_clear = UVH_EVENT_OCCURRED0_ALIAS;
251253
uvh_nmi_mmrx_shift = UVH_EVENT_OCCURRED0_EXTIO_INT0_SHFT;
@@ -255,26 +257,25 @@ static void uv_nmi_setup_mmrs(void)
255257
uvh_nmi_mmrx_req = UVH_BIOS_KERNEL_MMR_ALIAS_2;
256258
uvh_nmi_mmrx_req_shift = 62;
257259

258-
} else if (UVH_EVENT_OCCURRED1_EXTIO_INT0_MASK) {
260+
} else if (UVH_EVENT_OCCURRED1_EXTIO_INT0_MASK) { /* UV5+ setup */
259261
uvh_nmi_mmrx = UVH_EVENT_OCCURRED1;
260262
uvh_nmi_mmrx_clear = UVH_EVENT_OCCURRED1_ALIAS;
261263
uvh_nmi_mmrx_shift = UVH_EVENT_OCCURRED1_EXTIO_INT0_SHFT;
262264
uvh_nmi_mmrx_type = "OCRD1-EXTIO_INT0";
263265

264-
uvh_nmi_mmrx_supported = UVH_EXTIO_INT0_BROADCAST;
265-
uvh_nmi_mmrx_req = UVH_BIOS_KERNEL_MMR_ALIAS_2;
266-
uvh_nmi_mmrx_req_shift = 62;
266+
new_nmi_method_only = true; /* Newer nmi always valid on UV5+ */
267+
uvh_nmi_mmrx_req = 0; /* no request bit to clear */
267268

268269
} else {
269-
pr_err("UV:%s:cannot find EVENT_OCCURRED*_EXTIO_INT0\n",
270-
__func__);
270+
pr_err("UV:%s:NMI support not available on this system\n", __func__);
271271
return;
272272
}
273273

274274
/* Then find out if new NMI is supported */
275-
if (likely(uv_read_local_mmr(uvh_nmi_mmrx_supported))) {
276-
uv_write_local_mmr(uvh_nmi_mmrx_req,
277-
1UL << uvh_nmi_mmrx_req_shift);
275+
if (new_nmi_method_only || uv_read_local_mmr(uvh_nmi_mmrx_supported)) {
276+
if (uvh_nmi_mmrx_req)
277+
uv_write_local_mmr(uvh_nmi_mmrx_req,
278+
1UL << uvh_nmi_mmrx_req_shift);
278279
nmi_mmr = uvh_nmi_mmrx;
279280
nmi_mmr_clear = uvh_nmi_mmrx_clear;
280281
nmi_mmr_pending = 1UL << uvh_nmi_mmrx_shift;

0 commit comments

Comments
 (0)