From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752737AbcIBIoA (ORCPT ); Fri, 2 Sep 2016 04:44:00 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53284 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752206AbcIBIn5 (ORCPT ); Fri, 2 Sep 2016 04:43:57 -0400 Date: Fri, 2 Sep 2016 10:41:25 +0200 (CEST) From: Thomas Gleixner To: Yazen Ghannam cc: mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/AMD: Fix Socket ID for LLC topology for AMD Fam17h systems In-Reply-To: <1472674900-60688-1-git-send-email-Yazen.Ghannam@amd.com> Message-ID: References: <1472674900-60688-1-git-send-email-Yazen.Ghannam@amd.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 31 Aug 2016, Yazen Ghannam wrote: > The Socket ID is ApicId[bits] on Fam17h systems. > > Change substraction to logical AND when extracting socket_id > from c->apicid. So Fam17h will only ever have 2 sockets, right? Thanks, tglx > Signed-off-by: Yazen Ghannam > --- > arch/x86/kernel/cpu/amd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c > index f5c69d8..479555f 100644 > --- a/arch/x86/kernel/cpu/amd.c > +++ b/arch/x86/kernel/cpu/amd.c > @@ -365,7 +365,7 @@ static void amd_detect_cmp(struct cpuinfo_x86 *c) > if (c->x86 != 0x17 || !cpuid_edx(0x80000006)) > return; > > - socket_id = (c->apicid >> bits) - 1; > + socket_id = (c->apicid >> bits) & 1; > core_complex_id = (c->apicid & ((1 << bits) - 1)) >> 3; > > per_cpu(cpu_llc_id, cpu) = (socket_id << 3) | core_complex_id; > -- > 1.9.1 > >