Commit 22ac2bca authored by Mike Travis's avatar Mike Travis Committed by Ingo Molnar

x86/platform/UV: Fix problem with UV4 BIOS providing incorrect PXM values

There are some circumstances where the UV4 BIOS cannot provide the
correct Proximity Node values to associate with specific Sockets and
Physical Nodes.  The decision was made to remove these values from BIOS
and for the kernel to get these values from the standard ACPI tables.
Tested-by: default avatarFrank Ramsay <framsay@sgi.com>
Tested-by: default avatarJohn Estabrook <estabrook@sgi.com>
Signed-off-by: default avatarMike Travis <travis@sgi.com>
Reviewed-by: default avatarDimitri Sivanich <sivanich@sgi.com>
Reviewed-by: default avatarNathan Zimmer <nzimmer@sgi.com>
Cc: Alex Thorlton <athorlton@sgi.com>
Cc: Andrew Banman <abanman@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russ Anderson <rja@sgi.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20160801184050.414210079@asylum.americas.sgi.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent e363d24c
...@@ -79,7 +79,7 @@ struct uv_gam_range_entry { ...@@ -79,7 +79,7 @@ struct uv_gam_range_entry {
u16 nasid; /* HNasid */ u16 nasid; /* HNasid */
u16 sockid; /* Socket ID, high bits of APIC ID */ u16 sockid; /* Socket ID, high bits of APIC ID */
u16 pnode; /* Index to MMR and GRU spaces */ u16 pnode; /* Index to MMR and GRU spaces */
u32 pxm; /* ACPI proximity domain number */ u32 unused2;
u32 limit; /* PA bits 56:26 (UV_GAM_RANGE_SHFT) */ u32 limit; /* PA bits 56:26 (UV_GAM_RANGE_SHFT) */
}; };
...@@ -88,7 +88,8 @@ struct uv_gam_range_entry { ...@@ -88,7 +88,8 @@ struct uv_gam_range_entry {
#define UV_SYSTAB_VERSION_UV4 0x400 /* UV4 BIOS base version */ #define UV_SYSTAB_VERSION_UV4 0x400 /* UV4 BIOS base version */
#define UV_SYSTAB_VERSION_UV4_1 0x401 /* + gpa_shift */ #define UV_SYSTAB_VERSION_UV4_1 0x401 /* + gpa_shift */
#define UV_SYSTAB_VERSION_UV4_2 0x402 /* + TYPE_NVRAM/WINDOW/MBOX */ #define UV_SYSTAB_VERSION_UV4_2 0x402 /* + TYPE_NVRAM/WINDOW/MBOX */
#define UV_SYSTAB_VERSION_UV4_LATEST UV_SYSTAB_VERSION_UV4_2 #define UV_SYSTAB_VERSION_UV4_3 0x403 /* - GAM Range PXM Value */
#define UV_SYSTAB_VERSION_UV4_LATEST UV_SYSTAB_VERSION_UV4_3
#define UV_SYSTAB_TYPE_UNUSED 0 /* End of table (offset == 0) */ #define UV_SYSTAB_TYPE_UNUSED 0 /* End of table (offset == 0) */
#define UV_SYSTAB_TYPE_GAM_PARAMS 1 /* GAM PARAM conversions */ #define UV_SYSTAB_TYPE_GAM_PARAMS 1 /* GAM PARAM conversions */
......
...@@ -1156,19 +1156,18 @@ static void __init decode_gam_rng_tbl(unsigned long ptr) ...@@ -1156,19 +1156,18 @@ static void __init decode_gam_rng_tbl(unsigned long ptr)
for (; gre->type != UV_GAM_RANGE_TYPE_UNUSED; gre++) { for (; gre->type != UV_GAM_RANGE_TYPE_UNUSED; gre++) {
if (!index) { if (!index) {
pr_info("UV: GAM Range Table...\n"); pr_info("UV: GAM Range Table...\n");
pr_info("UV: # %20s %14s %5s %4s %5s %3s %2s %3s\n", pr_info("UV: # %20s %14s %5s %4s %5s %3s %2s\n",
"Range", "", "Size", "Type", "NASID", "Range", "", "Size", "Type", "NASID",
"SID", "PN", "PXM"); "SID", "PN");
} }
pr_info( pr_info(
"UV: %2d: 0x%014lx-0x%014lx %5luG %3d %04x %02x %02x %3d\n", "UV: %2d: 0x%014lx-0x%014lx %5luG %3d %04x %02x %02x\n",
index++, index++,
(unsigned long)lgre << UV_GAM_RANGE_SHFT, (unsigned long)lgre << UV_GAM_RANGE_SHFT,
(unsigned long)gre->limit << UV_GAM_RANGE_SHFT, (unsigned long)gre->limit << UV_GAM_RANGE_SHFT,
((unsigned long)(gre->limit - lgre)) >> ((unsigned long)(gre->limit - lgre)) >>
(30 - UV_GAM_RANGE_SHFT), /* 64M -> 1G */ (30 - UV_GAM_RANGE_SHFT), /* 64M -> 1G */
gre->type, gre->nasid, gre->sockid, gre->type, gre->nasid, gre->sockid, gre->pnode);
gre->pnode, gre->pxm);
lgre = gre->limit; lgre = gre->limit;
if (sock_min > gre->sockid) if (sock_min > gre->sockid)
...@@ -1287,7 +1286,7 @@ static void __init build_socket_tables(void) ...@@ -1287,7 +1286,7 @@ static void __init build_socket_tables(void)
_pnode_to_socket[i] = SOCK_EMPTY; _pnode_to_socket[i] = SOCK_EMPTY;
/* fill in pnode/node/addr conversion list values */ /* fill in pnode/node/addr conversion list values */
pr_info("UV: GAM Building socket/pnode/pxm conversion tables\n"); pr_info("UV: GAM Building socket/pnode conversion tables\n");
for (; gre->type != UV_GAM_RANGE_TYPE_UNUSED; gre++) { for (; gre->type != UV_GAM_RANGE_TYPE_UNUSED; gre++) {
if (gre->type == UV_GAM_RANGE_TYPE_HOLE) if (gre->type == UV_GAM_RANGE_TYPE_HOLE)
continue; continue;
...@@ -1295,20 +1294,18 @@ static void __init build_socket_tables(void) ...@@ -1295,20 +1294,18 @@ static void __init build_socket_tables(void)
if (_socket_to_pnode[i] != SOCK_EMPTY) if (_socket_to_pnode[i] != SOCK_EMPTY)
continue; /* duplicate */ continue; /* duplicate */
_socket_to_pnode[i] = gre->pnode; _socket_to_pnode[i] = gre->pnode;
_socket_to_node[i] = gre->pxm;
i = gre->pnode - minpnode; i = gre->pnode - minpnode;
_pnode_to_socket[i] = gre->sockid; _pnode_to_socket[i] = gre->sockid;
pr_info( pr_info(
"UV: sid:%02x type:%d nasid:%04x pn:%02x pxm:%2d pn2s:%2x\n", "UV: sid:%02x type:%d nasid:%04x pn:%02x pn2s:%2x\n",
gre->sockid, gre->type, gre->nasid, gre->sockid, gre->type, gre->nasid,
_socket_to_pnode[gre->sockid - minsock], _socket_to_pnode[gre->sockid - minsock],
_socket_to_node[gre->sockid - minsock],
_pnode_to_socket[gre->pnode - minpnode]); _pnode_to_socket[gre->pnode - minpnode]);
} }
/* check socket -> node values */ /* Set socket -> node values */
lnid = -1; lnid = -1;
for_each_present_cpu(cpu) { for_each_present_cpu(cpu) {
int nid = cpu_to_node(cpu); int nid = cpu_to_node(cpu);
...@@ -1319,14 +1316,9 @@ static void __init build_socket_tables(void) ...@@ -1319,14 +1316,9 @@ static void __init build_socket_tables(void)
lnid = nid; lnid = nid;
apicid = per_cpu(x86_cpu_to_apicid, cpu); apicid = per_cpu(x86_cpu_to_apicid, cpu);
sockid = apicid >> uv_cpuid.socketid_shift; sockid = apicid >> uv_cpuid.socketid_shift;
i = sockid - minsock; _socket_to_node[sockid - minsock] = nid;
pr_info("UV: sid:%02x: apicid:%04x node:%2d\n",
if (nid != _socket_to_node[i]) { sockid, apicid, nid);
pr_warn(
"UV: %02x: type:%d socket:%02x PXM:%02x != node:%2d\n",
i, sockid, gre->type, _socket_to_node[i], nid);
_socket_to_node[i] = nid;
}
} }
/* Setup physical blade to pnode translation from GAM Range Table */ /* Setup physical blade to pnode translation from GAM Range Table */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment