From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933181AbcHJSMK (ORCPT ); Wed, 10 Aug 2016 14:12:10 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56692 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932804AbcHJSLt (ORCPT ); Wed, 10 Aug 2016 14:11:49 -0400 Date: Wed, 10 Aug 2016 11:11:16 -0700 From: tip-bot for Mike Travis Message-ID: Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, nzimmer@sgi.com, rja@sgi.com, akpm@linux-foundation.org, travis@sgi.com, torvalds@linux-foundation.org, framsay@sgi.com, abanman@sgi.com, estabrook@sgi.com, athorlton@sgi.com, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de, sivanich@sgi.com Reply-To: abanman@sgi.com, framsay@sgi.com, akpm@linux-foundation.org, torvalds@linux-foundation.org, travis@sgi.com, nzimmer@sgi.com, peterz@infradead.org, linux-kernel@vger.kernel.org, rja@sgi.com, sivanich@sgi.com, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, estabrook@sgi.com, athorlton@sgi.com In-Reply-To: <20160801184050.048755337@asylum.americas.sgi.com> References: <20160801184050.048755337@asylum.americas.sgi.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/platform/UV: Fix problem with UV4 Socket IDs not being contiguous Git-Commit-ID: 054f621fd5b1c7245710f5d3935c94ce6ae4b3b7 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 054f621fd5b1c7245710f5d3935c94ce6ae4b3b7 Gitweb: http://git.kernel.org/tip/054f621fd5b1c7245710f5d3935c94ce6ae4b3b7 Author: Mike Travis AuthorDate: Mon, 1 Aug 2016 13:40:50 -0500 Committer: Ingo Molnar CommitDate: Wed, 10 Aug 2016 15:55:38 +0200 x86/platform/UV: Fix problem with UV4 Socket IDs not being contiguous The UV4 Socket IDs are not guaranteed to equate to Node values which can cause the GAM (Global Addressable Memory) table lookups to fail. Fix this by using an independent index into the GAM table instead of the Socket ID to reference the base address. Tested-by: Frank Ramsay Tested-by: John Estabrook Signed-off-by: Mike Travis Reviewed-by: Dimitri Sivanich Reviewed-by: Nathan Zimmer Cc: Alex Thorlton Cc: Andrew Banman Cc: Andrew Morton Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Russ Anderson Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20160801184050.048755337@asylum.americas.sgi.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/apic/x2apic_uv_x.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 09b59ad..d918733 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c @@ -325,7 +325,7 @@ static __init void build_uv_gr_table(void) struct uv_gam_range_entry *gre = uv_gre_table; struct uv_gam_range_s *grt; unsigned long last_limit = 0, ram_limit = 0; - int bytes, i, sid, lsid = -1; + int bytes, i, sid, lsid = -1, indx = 0, lindx = -1; if (!gre) return; @@ -356,11 +356,12 @@ static __init void build_uv_gr_table(void) } sid = gre->sockid - _min_socket; if (lsid < sid) { /* new range */ - grt = &_gr_table[sid]; - grt->base = lsid; + grt = &_gr_table[indx]; + grt->base = lindx; grt->nasid = gre->nasid; grt->limit = last_limit = gre->limit; lsid = sid; + lindx = indx++; continue; } if (lsid == sid && !ram_limit) { /* update range */ @@ -371,7 +372,7 @@ static __init void build_uv_gr_table(void) } if (!ram_limit) { /* non-contiguous ram range */ grt++; - grt->base = sid - 1; + grt->base = lindx; grt->nasid = gre->nasid; grt->limit = last_limit = gre->limit; continue;