Received: by 10.192.165.148 with SMTP id m20csp536460imm; Wed, 25 Apr 2018 03:53:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Gq2JX49Lc4AqflUrytw/D4zGE8rVcX8VaBIbZCbxilfrX/aGc1bll8yJBrfq7D/aco8Wb X-Received: by 2002:a17:902:9a9:: with SMTP id 38-v6mr29338001pln.114.1524653607796; Wed, 25 Apr 2018 03:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524653607; cv=none; d=google.com; s=arc-20160816; b=jLD5yDnC0FKgyt8cW34inRycQFE3eobg9M6NzXo1LbSQrS0YgdgG8W7iQ8E0tSb5OF yxkkhTbjDGrFk+oO89FDl34JtpcolMUumo3ZjBe1cRzkpjaKOMBL0QgaAp9YregDzacj xu2cWWI9nW6wPpJXu9Vug7aVym8XCxntcOiMXh30O4I9aNfAArhanR5ZP1vcW+3CMqki LqzpwtwR7zzmheHzy8T1pQtMZfPxN0JZOD5zq+SoZGDWq6ZViCzqr5SNl+jAT6+JLi1W vWqMxzGCjGjbGZm/KqUyqjuEmffCpJVAsUk8KJQW4ZB2ijz3E7eV6MWTxyvJNyf6PyUI slCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=2+qztCyquD1OyyKtd8KWHZVk9a4uRPpHImlZAoLQPbQ=; b=ktfuFJgvEHM+qBkz3gU26ESewEXkAeEzpaYtVFUcF7ySOxh8dVINOfGTHrF2M9jOJp bHNsqKwHDctI7PZmDAce7oLf5ONXv3yGhjGKZ4wWGIZGwfG307UPtDo/HOWlF/CQBzaV Lxf9Umg8VDv64gi7KJeKQmJX8Y5JtyFMQDqwJpaT/+xrpsUo6qyQqUp+n/9XLBnJ/wx+ WszyGrYymQd67RFS3yTR5a8sxhcDQROn7IJzZtVwD+jr/on1a8f9AGPdya1qLA+nsyGm 6m53Pnc6MYsA1VG8/CQGZCP7VljukaydVBZ3TLWa1uIUveubVV5crqFHecU0qGBtPstp 1nfw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12-v6si16776812plo.29.2018.04.25.03.53.13; Wed, 25 Apr 2018 03:53:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754208AbeDYKv5 (ORCPT + 99 others); Wed, 25 Apr 2018 06:51:57 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53240 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbeDYKoJ (ORCPT ); Wed, 25 Apr 2018 06:44:09 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7BF3441C; Wed, 25 Apr 2018 10:44:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Travis , Andrew Banman , Dimitri Sivanich , Linus Torvalds , Peter Zijlstra , Russ Anderson , Thomas Gleixner , Ingo Molnar , Sasha Levin Subject: [PATCH 4.14 165/183] x86/platform/UV: Fix GAM Range Table entries less than 1GB Date: Wed, 25 Apr 2018 12:36:25 +0200 Message-Id: <20180425103249.151523954@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/apic/x2apic_uv_x.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) --- 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(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;