From: <mike.travis@hpe.com>
To: Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org, Andrew Banman <andrew.banman@hpe.com>,
Dimitri Sivanich <dimitri.sivanich@hpe.com>,
Russ Anderson <russ.anderson@hpe.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] x86/platform/UV: Fix GAM Range Table entries less than 1GB
Date: Mon, 05 Feb 2018 16:15:04 -0600 [thread overview]
Message-ID: <20180205221503.190219903@stormcage.americas.sgi.com> (raw)
In-Reply-To: 20180205221503.032756454@stormcage.americas.sgi.com
[-- 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;
--
next prev parent reply other threads:[~2018-02-05 22:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2018-02-13 15:25 ` [tip:x86/urgent] " tip-bot for mike.travis@hpe.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180205221503.190219903@stormcage.americas.sgi.com \
--to=mike.travis@hpe.com \
--cc=andrew.banman@hpe.com \
--cc=dimitri.sivanich@hpe.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=russ.anderson@hpe.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox