Received: by 10.213.65.68 with SMTP id h4csp2136030imn; Sun, 8 Apr 2018 20:37:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/yUBpRTomLGULm4BaiKppYPhUupKXdekjmzJs4+VFFJ7qGYfhHXg/wyt9wYKMFabnT77D0 X-Received: by 10.98.153.204 with SMTP id t73mr27879784pfk.121.1523245035736; Sun, 08 Apr 2018 20:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523245035; cv=none; d=google.com; s=arc-20160816; b=UBKkqXA2DIvRDXcXgY7Zu3rtYYOX78RWbLUvg5lOfsqbTSZhkUV1abTmR84EI28jf1 awxUq54XVkX00/TJiwkH1zw8TI6WXBEsUYcRxw1tjlSonWwQwJ1kiiYZkv6U7BhqQMmf eQQRYLOEQU1hXTavkw4rNlV8PJzPY2DDi+r2Xhg+Bwdoy/dY+tiTENFeZUIIyA6cse+q vDy7QlYgtlc6x97wd6jnP5e0YGEJ7gi3kG1t0d9V/VdCqLJ1KlHQgT7CmJNhtGh/xKjJ un5b8Ut3sI3Og0ekyi+Dpkze2AP1F/I8VK5mEvg3XuFy40tYt1i0HtOjxMQUwN91OTvQ iSxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=y7O79CQMNjUspdHeRfaZIZ3J6icjKWafBqwgOpZFhi8=; b=xOEEoYYHUIdhfxiM4yAqFy+kxgququXr+ztLJMYzaYfho7N1CKOEVVFxatFuMvRihy QcNRb1jh9lAk427qrCGxF7E8XBpwFsGS898TF802XXi7VyZ+UeSZvbVORc0b1W1bni8v Zvw6Kfq1uNxtmkz2vgHfEUYmTF5iWwq/IwBTPQCA01ir3I+cbDZ9tPQElLN9CKX8ClLQ rusqJkbmAl0opb2CBJWGqoQcEHL2NKXrdjpU5AbcdDnIx1y7+eGZSkhcXpZm9ub/I/uH sToLASOo0CcLzlDGoOfAfmVEWO8Yuy/w9oSeSXiCz9oBBRc45jV7WJGCHszKzXO4Onde p+jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=TGfPq/4o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s187si10588953pgb.729.2018.04.08.20.36.38; Sun, 08 Apr 2018 20:37:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=TGfPq/4o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754676AbeDIDbz (ORCPT + 99 others); Sun, 8 Apr 2018 23:31:55 -0400 Received: from mail-bl2nam02on0124.outbound.protection.outlook.com ([104.47.38.124]:27520 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754502AbeDIAVw (ORCPT ); Sun, 8 Apr 2018 20:21:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=y7O79CQMNjUspdHeRfaZIZ3J6icjKWafBqwgOpZFhi8=; b=TGfPq/4otcpr8gc0VafLqQESdLpDozkGFHNQPi1ijUNbKh+ND8NBQjJOfJgnkLAZx+YLplkvpLy7pXyCUcIEi+34oK4Prs3PioIP8iIzVntl3VbXzOlEmuckK8MOy0ku9BrsKMeetJPX/vxTI+MdBrzCbA9SXLUqeWUEYr0jUGY= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1125.namprd21.prod.outlook.com (52.132.130.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:21:50 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:21:50 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "mike.travis@hpe.com" , Linus Torvalds , Peter Zijlstra , Russ Anderson , Thomas Gleixner , Ingo Molnar , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 183/189] x86/platform/UV: Fix GAM Range Table entries less than 1GB Thread-Topic: [PATCH AUTOSEL for 4.15 183/189] x86/platform/UV: Fix GAM Range Table entries less than 1GB Thread-Index: AQHTz5hjIKLAnWYlfk+K5uAuW2BIew== Date: Mon, 9 Apr 2018 00:19:13 +0000 Message-ID: <20180409001637.162453-183-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1125;7:IkQldqIzenIrHJOOKnw0/EW5x4dpiRyIE5ALwdrfsHgAJp8i3R1WZNdGa5wafhUU6kZTWmRGRBYZuBcTuzd/Pp+SlbsoReTcHV6lwCDb4Tha1ZzLDFJZfJku+SuRNZjE8jev9oU9OKzdyXe6XG6Db51NrOKz1y03NfUATVo4//e7uHMqlGeobLV5GyAYLZ3qe2Ba/s9kuGCJkHukaKGnu+6Bwr0JnrByt5mgOnjrGxlPGbbfK46XoqZTMmboMsWo;20:FJRo0DDFaDfAgaqMDmiF+tjWugFfOVwWlpeaBM83LOrpniGVVsaN+UFGHBfUK/bbIg2bKuUtFTkM6x5C0AG0BwUecGGB95bCgZLUPAJSaCHbF3cumEu8BrOQxYPCTA0COmm8I2V+WzFe8amJ824I6/zGmtLDSaj5rUBmOilyhiE= X-MS-Office365-Filtering-Correlation-Id: 0cbe7a99-9ff5-46a1-fa3d-08d59dafe33e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:(222181515654134);BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB1125; x-ms-traffictypediagnostic: DM5PR2101MB1125: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(227479698468861)(89211679590171)(42068640409301)(222181515654134); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1125;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1125; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(376002)(396003)(39380400002)(39860400002)(346002)(199004)(189003)(105586002)(7736002)(8676002)(97736004)(81166006)(59450400001)(106356001)(966005)(81156014)(305945005)(14454004)(66066001)(1076002)(102836004)(5250100002)(478600001)(2501003)(2900100001)(22452003)(72206003)(68736007)(26005)(86362001)(8936002)(76176011)(6506007)(6116002)(6486002)(186003)(5660300001)(6306002)(3660700001)(316002)(54906003)(110136005)(25786009)(2906002)(10090500001)(6512007)(3280700002)(6666003)(10290500003)(53936002)(99286004)(86612001)(3846002)(6436002)(486006)(4326008)(2616005)(11346002)(107886003)(36756003)(476003)(446003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1125;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: DQflqopYSwEWpXHwESPQ1cE0QuB1gHdcloyBEZsgC/0yochCcS8Z+gAVbK8dWMpx+fdZga2oZ4AmonHCc2N1GwgvkdKfrA7LjiTUcnTnjVSlgQPNeEDbfD/VTw0S2ZwOCEtl7s0qFAfjGn66zltRnZ7ioz4PrtsRhRHTCQRGgP4NWGwXNXRwsb029PKuOGo7jCzuzvkvI9qbfcXt/Dr1O+FNWybhLzZ/duBDMmIOaE7ciz5VjLK+ZyKdQG0imxTxOeezh6xY3/sybHcfwWxjGAxA1DmtK6R6Miz3eZNO0QquAQIjLC7kHslDoHt2zOTuTm8/ghVnkaYXNpC0z0WcojsNU/yiIB7vm3oRgOPlTkaGaG3cOxsi5AgdbZbnjGZjM+RafB/KuBliN78ThTZRecPvgxbeK1jUVPRUfaj3F+M= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cbe7a99-9ff5-46a1-fa3d-08d59dafe33e X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:19:13.3612 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1125 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "mike.travis@hpe.com" [ Upstream commit c25d99d20ba69824a1e2cc118e04b877cd427afc ] 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 Reviewed-by: Andrew Banman Reviewed-by: Dimitri Sivanich Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Russ Anderson Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20180205221503.190219903@stormcage.americas.= sgi.com Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- 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/x2ap= ic_uv_x.c index e1b8e8bf6b3c..256a9924b8d8 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -1174,16 +1174,25 @@ static void __init decode_gam_rng_tbl(unsigned long= ptr) =20 uv_gre_table =3D gre; for (; gre->type !=3D UV_GAM_RANGE_TYPE_UNUSED; gre++) { + unsigned long size =3D ((unsigned long)(gre->limit - lgre) + << UV_GAM_RANGE_SHFT); + int order =3D 0; + char suffix[] =3D " KMGTPE"; + + while (size > 9999 && order < sizeof(suffix)) { + size /=3D 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); =20 lgre =3D gre->limit; --=20 2.15.1