Skip to content

Commit c25d99d

Browse files
mike-travisIngo Molnar
authored andcommitted
x86/platform/UV: Fix GAM Range Table entries less than 1GB
The latest UV platforms include the new ApachePass NVDIMMs into the UV address space. This has introduced address ranges in the Global Address Map Table that are less than the previous lowest range, which was 2GB. Fix the address calculation so it accommodates address ranges from bytes to exabytes. Signed-off-by: Mike Travis <[email protected]> Reviewed-by: Andrew Banman <[email protected]> Reviewed-by: Dimitri Sivanich <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Russ Anderson <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 74eb816 commit c25d99d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,16 +1176,25 @@ static void __init decode_gam_rng_tbl(unsigned long ptr)
11761176

11771177
uv_gre_table = gre;
11781178
for (; gre->type != UV_GAM_RANGE_TYPE_UNUSED; gre++) {
1179+
unsigned long size = ((unsigned long)(gre->limit - lgre)
1180+
<< UV_GAM_RANGE_SHFT);
1181+
int order = 0;
1182+
char suffix[] = " KMGTPE";
1183+
1184+
while (size > 9999 && order < sizeof(suffix)) {
1185+
size /= 1024;
1186+
order++;
1187+
}
1188+
11791189
if (!index) {
11801190
pr_info("UV: GAM Range Table...\n");
11811191
pr_info("UV: # %20s %14s %5s %4s %5s %3s %2s\n", "Range", "", "Size", "Type", "NASID", "SID", "PN");
11821192
}
1183-
pr_info("UV: %2d: 0x%014lx-0x%014lx %5luG %3d %04x %02x %02x\n",
1193+
pr_info("UV: %2d: 0x%014lx-0x%014lx %5lu%c %3d %04x %02x %02x\n",
11841194
index++,
11851195
(unsigned long)lgre << UV_GAM_RANGE_SHFT,
11861196
(unsigned long)gre->limit << UV_GAM_RANGE_SHFT,
1187-
((unsigned long)(gre->limit - lgre)) >>
1188-
(30 - UV_GAM_RANGE_SHFT), /* 64M -> 1G */
1197+
size, suffix[order],
11891198
gre->type, gre->nasid, gre->sockid, gre->pnode);
11901199

11911200
lgre = gre->limit;

0 commit comments

Comments
 (0)