Received: by 10.213.65.68 with SMTP id h4csp2121824imn; Sun, 8 Apr 2018 20:14:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/KRe1Vfp6eUcVrmFvJNU/SrotGUAbbA56C9jkm3c3pTEM80vmmWRSn58CuLWLEaeqbQ0ND X-Received: by 2002:a17:902:5a3:: with SMTP id f32-v6mr23342863plf.287.1523243665402; Sun, 08 Apr 2018 20:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243665; cv=none; d=google.com; s=arc-20160816; b=dJYX5moPZ1hcePigYX7IwqxQIXyIMh0Wjomx56AXwIqI+HH0CrPXwfMYqXTLT+97Cd K00gxIbIMRQOkPngLuIDJtTcYngjJSMkguCYADqg1P0tBqXOGGQ/pd6EOR4zzKV14zl9 xwE4WxHjZv/uMqtvWdRpWTHRp2usVhPWA+dlyJdLGRthZED7nxBKcCLIGcSOCnSZiG+I g4B+G5MjHtWLZdRIupAMLuoZskWeHq79ZlREPc1dmJAUjGjvJQ2gc2itzbYIJXWZ+US8 4D7GWjGXshwX8z5LTADI33m4UrZiQwxn7hWo/VxcTML7jonr5PnuUqrDN5pGitTE4NCv ShDg== 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=pL3aAjKKuXgecQcNj1TFVJ/cndlp8RXLYTfGIB1F5io=; b=A+iKnRgDxnyj3X0syQ3awQ9zccePD0DISVnkvN2Ok1j9Hmw5d++pi2IDdY0nzt4Vz5 r5xXcxERJQjU93HVyPrR+gPeKeu3mhRIjZVj+A79oQiub47OMcALGHhwCL/sC0FMPPPp RfrVfeEmYL0UP/Zc0oBfFvLu5FWCn7DQMltM3OuJxsNptKSTX2MAauvz4ytQufgGKfpr R8gqX9OFRH59ewm9v17p5fwMouuxBbCVI7bGyRsFOXsz9JMtCVdwGezHjS4yP9THRGVb BeAqN3QRkYYfa/WNjRiHwzieETNCblLm8DTj9XkZkjohQGlrfSrq2lXgvR/BlhRHMVec sXFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=F07AZrtJ; 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 p10si11600969pff.72.2018.04.08.20.13.48; Sun, 08 Apr 2018 20:14:25 -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=F07AZrtJ; 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 S1755828AbeDICtE (ORCPT + 98 others); Sun, 8 Apr 2018 22:49:04 -0400 Received: from mail-by2nam03on0131.outbound.protection.outlook.com ([104.47.42.131]:4960 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755362AbeDIA0f (ORCPT ); Sun, 8 Apr 2018 20:26:35 -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=pL3aAjKKuXgecQcNj1TFVJ/cndlp8RXLYTfGIB1F5io=; b=F07AZrtJC3aNbhM2l0ZEaPd1cSm90BfGKPZHWbSiBhJT6IOmvyiwWX3Xu9tNC54l1eBsW3+RfMhRNVj8YRFslpd8NzM1TWYo79WDvdvELE+jwFyRmkDjGfjkQGFJeL2CTATZQ66CyikSgoUXHsxAzaQIse69JPgVT/IqyPKpLn0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0725.namprd21.prod.outlook.com (10.167.107.167) 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:26:24 +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:26:24 +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.14 155/161] x86/platform/UV: Fix GAM Range Table entries less than 1GB Thread-Topic: [PATCH AUTOSEL for 4.14 155/161] x86/platform/UV: Fix GAM Range Table entries less than 1GB Thread-Index: AQHTz5jHsYAcyTUw0EmELQwh0iyXQA== Date: Mon, 9 Apr 2018 00:22:00 +0000 Message-ID: <20180409001936.162706-155-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-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;DM5PR2101MB0725;7:VuJF5kWT1BB2KGRUybQ4QKWuuvJ8LsECx2njJucC5rbcNdAEzmhuQBX6w5Q1J19zBORFCdxkUILxqZgNW9DMNu9TlXLbSCk+MNBnkNauA6SBNFdMocqXDZElRUXumqVKGX9J7M9KTQ7EQP8Rrot8/iVCL+HvEVhHYa+1nW5QaMVjZnc6mWdtbu6tK9QORQjXxel5D6c6eggPpqgEjgJi74IDWOtpboIey3XjGmVlUOHDWnHmSDTVbaWH/Y7+e9aH;20:0eMATQffp7sppbPHxON1ZnsK50Ji/i7+naQ5CCpvbaPq6wtTP5zl6W9CKYDf914AY2FKwMDHKM+j566yT87LNdsGTkKx1TtlpcXtUQGrkVSC4jFMcV6BWuHwuxzf4PPMSPvRfZSSSWoGx/D+GBPZ1aXSRH2HX7YcOi5J/vowliI= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 3a29f283-b041-4f99-cb4e-08d59db08709 x-microsoft-antispam: UriScan:(222181515654134);BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0725; x-ms-traffictypediagnostic: DM5PR2101MB0725: 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)(5005006)(8121501046)(10201501046)(3231221)(944501327)(52105095)(93006095)(93001095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0725;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0725; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(346002)(366004)(376002)(396003)(39860400002)(199004)(189003)(6486002)(81166006)(26005)(6512007)(6306002)(4326008)(6666003)(6436002)(81156014)(8676002)(97736004)(186003)(36756003)(72206003)(53936002)(107886003)(2906002)(966005)(86362001)(76176011)(110136005)(305945005)(10090500001)(486006)(3660700001)(102836004)(5660300001)(14454004)(476003)(575784001)(86612001)(446003)(99286004)(68736007)(66066001)(11346002)(54906003)(2616005)(1076002)(7736002)(5250100002)(25786009)(8936002)(478600001)(2900100001)(2501003)(3280700002)(105586002)(59450400001)(316002)(106356001)(22452003)(6506007)(3846002)(10290500003)(6116002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0725;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: jwlixcnAqTDtYoj4vJiFlGUSmrJJ/gIHfCj956ovtnd4tNR+FfqTIXyDC6Ibv5Zbcv3P7NJVpbnjQIKC8vNHbSVkM45OZK23h2Rdnr/exT6Rwy56qwa3zyuRoU4qK2BCIQtLkuRQt9phZj1NjHAAJQh0w0F6pmvrxmj0ll6t20g2bBkrQo1FLNDTBj84iR1SSYqsH6FIkdyemRXGmAAJzj+teXiFTzTsPr/Tt9jgxWPPgSviC678PYJZs10R+HSwnJVYDHfJWBspBOcgGluEyC3z0lVFMmZcuJB/B4PKdIi89t7A+PPWDS79F3UrU8YutBd/o10KUeCOdw84b0m+WSUe4wZ9eqK6F2hTkDL2Bwz2CxJABUQ0lvqD1cDk/Cg6Z5j6D7LPTd8uMKaPgyK4TMCzu4LkykZNp28uXEbrwAw= 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: 3a29f283-b041-4f99-cb4e-08d59db08709 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:22:00.6904 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0725 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 c0b694810ff4..02cfc615e3fb 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -1140,16 +1140,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