Skip to content

Commit 5350cb0

Browse files
mike-travisgregkh
authored andcommitted
x86/platform/UV: Fix GAM Range Table entries less than 1GB
[ Upstream commit c25d99d ] 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]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 288b373 commit 5350cb0

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
@@ -1140,16 +1140,25 @@ static void __init decode_gam_rng_tbl(unsigned long ptr)
11401140

11411141
uv_gre_table = gre;
11421142
for (; gre->type != UV_GAM_RANGE_TYPE_UNUSED; gre++) {
1143+
unsigned long size = ((unsigned long)(gre->limit - lgre)
1144+
<< UV_GAM_RANGE_SHFT);
1145+
int order = 0;
1146+
char suffix[] = " KMGTPE";
1147+
1148+
while (size > 9999 && order < sizeof(suffix)) {
1149+
size /= 1024;
1150+
order++;
1151+
}
1152+
11431153
if (!index) {
11441154
pr_info("UV: GAM Range Table...\n");
11451155
pr_info("UV: # %20s %14s %5s %4s %5s %3s %2s\n", "Range", "", "Size", "Type", "NASID", "SID", "PN");
11461156
}
1147-
pr_info("UV: %2d: 0x%014lx-0x%014lx %5luG %3d %04x %02x %02x\n",
1157+
pr_info("UV: %2d: 0x%014lx-0x%014lx %5lu%c %3d %04x %02x %02x\n",
11481158
index++,
11491159
(unsigned long)lgre << UV_GAM_RANGE_SHFT,
11501160
(unsigned long)gre->limit << UV_GAM_RANGE_SHFT,
1151-
((unsigned long)(gre->limit - lgre)) >>
1152-
(30 - UV_GAM_RANGE_SHFT), /* 64M -> 1G */
1161+
size, suffix[order],
11531162
gre->type, gre->nasid, gre->sockid, gre->pnode);
11541163

11551164
lgre = gre->limit;

0 commit comments

Comments
 (0)