linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] x86/platform/UV: Fix GAM Range Table entries less than 1GB
@ 2018-02-05 22:15 mike.travis
  2018-02-05 22:15 ` [PATCH 1/1] " mike.travis
  0 siblings, 1 reply; 3+ messages in thread
From: mike.travis @ 2018-02-05 22:15 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin
  Cc: x86, Andrew Banman, Dimitri Sivanich, Russ Anderson, linux-kernel


* Fix GAM Range Table address ranges less than 1GB.

-- 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] x86/platform/UV: Fix GAM Range Table entries less than 1GB
  2018-02-05 22:15 [PATCH 0/1] x86/platform/UV: Fix GAM Range Table entries less than 1GB mike.travis
@ 2018-02-05 22:15 ` mike.travis
  2018-02-13 15:25   ` [tip:x86/urgent] " tip-bot for mike.travis@hpe.com
  0 siblings, 1 reply; 3+ messages in thread
From: mike.travis @ 2018-02-05 22:15 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin
  Cc: x86, Andrew Banman, Dimitri Sivanich, Russ Anderson, linux-kernel

[-- Attachment #1: fix-gam-range-addr --]
[-- Type: text/plain, Size: 1672 bytes --]

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 <mike.travis@hpe.com>
Reviewed-by: Andrew Banman <andrew.banman@hpe.com>
Reviewed-by: Dimitri Sivanich <dimitri.sivanich@hpe.com>
---
 arch/x86/kernel/apic/x2apic_uv_x.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

--- linux-4.4.orig/arch/x86/kernel/apic/x2apic_uv_x.c
+++ linux-4.4/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -1174,16 +1174,25 @@ static void __init decode_gam_rng_tbl(un
 
 	uv_gre_table = gre;
 	for (; gre->type != UV_GAM_RANGE_TYPE_UNUSED; gre++) {
+		unsigned long size = ((unsigned long)(gre->limit - lgre)
+					<< UV_GAM_RANGE_SHFT);
+		int order = 0;
+		char suffix[] = " KMGTPE";
+
+		while (size > 9999 && order < sizeof(suffix)) {
+			size /= 1024;
+			order++;
+		}
+
 		if (!index) {
 			pr_info("UV: GAM Range Table...\n");
 			pr_info("UV:  # %20s %14s %5s %4s %5s %3s %2s\n", "Range", "", "Size", "Type", "NASID", "SID", "PN");
 		}
-		pr_info("UV: %2d: 0x%014lx-0x%014lx %5luG %3d   %04x  %02x %02x\n",
+		pr_info("UV: %2d: 0x%014lx-0x%014lx %5lu%c %3d   %04x  %02x %02x\n",
 			index++,
 			(unsigned long)lgre << UV_GAM_RANGE_SHFT,
 			(unsigned long)gre->limit << UV_GAM_RANGE_SHFT,
-			((unsigned long)(gre->limit - lgre)) >>
-				(30 - UV_GAM_RANGE_SHFT), /* 64M -> 1G */
+			size, suffix[order],
 			gre->type, gre->nasid, gre->sockid, gre->pnode);
 
 		lgre = gre->limit;

-- 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/urgent] x86/platform/UV: Fix GAM Range Table entries less than 1GB
  2018-02-05 22:15 ` [PATCH 1/1] " mike.travis
@ 2018-02-13 15:25   ` tip-bot for mike.travis@hpe.com
  0 siblings, 0 replies; 3+ messages in thread
From: tip-bot for mike.travis@hpe.com @ 2018-02-13 15:25 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: peterz, linux-kernel, torvalds, andrew.banman, russ.anderson,
	mike.travis, hpa, tglx, dimitri.sivanich, mingo

Commit-ID:  c25d99d20ba69824a1e2cc118e04b877cd427afc
Gitweb:     https://git.kernel.org/tip/c25d99d20ba69824a1e2cc118e04b877cd427afc
Author:     mike.travis@hpe.com <mike.travis@hpe.com>
AuthorDate: Mon, 5 Feb 2018 16:15:04 -0600
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 13 Feb 2018 14:15:45 +0100

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 <mike.travis@hpe.com>
Reviewed-by: Andrew Banman <andrew.banman@hpe.com>
Reviewed-by: Dimitri Sivanich <dimitri.sivanich@hpe.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russ Anderson <russ.anderson@hpe.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20180205221503.190219903@stormcage.americas.sgi.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/apic/x2apic_uv_x.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 46b675a..f11910b 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -1176,16 +1176,25 @@ static void __init decode_gam_rng_tbl(unsigned long ptr)
 
 	uv_gre_table = gre;
 	for (; gre->type != UV_GAM_RANGE_TYPE_UNUSED; gre++) {
+		unsigned long size = ((unsigned long)(gre->limit - lgre)
+					<< UV_GAM_RANGE_SHFT);
+		int order = 0;
+		char suffix[] = " KMGTPE";
+
+		while (size > 9999 && order < sizeof(suffix)) {
+			size /= 1024;
+			order++;
+		}
+
 		if (!index) {
 			pr_info("UV: GAM Range Table...\n");
 			pr_info("UV:  # %20s %14s %5s %4s %5s %3s %2s\n", "Range", "", "Size", "Type", "NASID", "SID", "PN");
 		}
-		pr_info("UV: %2d: 0x%014lx-0x%014lx %5luG %3d   %04x  %02x %02x\n",
+		pr_info("UV: %2d: 0x%014lx-0x%014lx %5lu%c %3d   %04x  %02x %02x\n",
 			index++,
 			(unsigned long)lgre << UV_GAM_RANGE_SHFT,
 			(unsigned long)gre->limit << UV_GAM_RANGE_SHFT,
-			((unsigned long)(gre->limit - lgre)) >>
-				(30 - UV_GAM_RANGE_SHFT), /* 64M -> 1G */
+			size, suffix[order],
 			gre->type, gre->nasid, gre->sockid, gre->pnode);
 
 		lgre = gre->limit;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-13 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-05 22:15 [PATCH 0/1] x86/platform/UV: Fix GAM Range Table entries less than 1GB mike.travis
2018-02-05 22:15 ` [PATCH 1/1] " mike.travis
2018-02-13 15:25   ` [tip:x86/urgent] " tip-bot for mike.travis@hpe.com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).