From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757505AbcG0RlJ (ORCPT ); Wed, 27 Jul 2016 13:41:09 -0400 Received: from relay3.sgi.com ([192.48.152.1]:43212 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757196AbcG0RlD (ORCPT ); Wed, 27 Jul 2016 13:41:03 -0400 X-Greylist: delayed 449 seconds by postgrey-1.27 at vger.kernel.org; Wed, 27 Jul 2016 13:41:03 EDT Message-Id: <20160727173331.472016865@asylum.americas.sgi.com> References: <20160727173331.230927085@asylum.americas.sgi.com> User-Agent: quilt/0.46-1 Date: Wed, 27 Jul 2016 12:33:32 -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 , x86@kernel.org, linux-kernel@vger.kernel.org, stable@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; --