From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755012AbcHATHN (ORCPT ); Mon, 1 Aug 2016 15:07:13 -0400 Received: from relay2.sgi.com ([192.48.180.65]:55723 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754817AbcHATGe (ORCPT ); Mon, 1 Aug 2016 15:06:34 -0400 Message-Id: <20160801184050.048755337@asylum.americas.sgi.com> References: <20160801184049.811754120@asylum.americas.sgi.com> User-Agent: quilt/0.46-1 Date: Mon, 01 Aug 2016 13:40:50 -0500 From: Mike Travis To: Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Andrew Morton , Dimitri Sivanich Cc: Russ Anderson , John Estabrook , Andrew Banman , Nathan Zimmer , Alex Thorlton , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] x86/platform/UV: Fix problem with UV4 Socket IDs not being contiguous Content-Disposition: inline; filename=uv4_fix_gam_range_lookup_table Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Reviewed-by: Dimitri Sivanich Reviewed-by: Nathan Zimmer Tested-by: Frank Ramsay Tested-by: John Estabrook Signed-off-by: Mike Travis --- arch/x86/kernel/apic/x2apic_uv_x.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- linux-3.12.orig/arch/x86/kernel/apic/x2apic_uv_x.c +++ linux-3.12/arch/x86/kernel/apic/x2apic_uv_x.c @@ -325,7 +325,7 @@ static __init void build_uv_gr_table(voi 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(voi } 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(voi } 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; --