mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yazen Ghannam <Yazen.Ghannam@amd.com>
To: <tglx@linutronix.de>, <mingo@redhat.com>, <hpa@zytor.com>,
	<x86@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, Yazen Ghannam <Yazen.Ghannam@amd.com>
Subject: [PATCH] x86/AMD: Fix Socket ID for LLC topology for AMD Fam17h systems
Date: Wed, 31 Aug 2016 15:21:40 -0500	[thread overview]
Message-ID: <1472674900-60688-1-git-send-email-Yazen.Ghannam@amd.com> (raw)

The Socket ID is ApicId[bits] on Fam17h systems.

Change substraction to logical AND when extracting socket_id
from c->apicid.

Signed-off-by: Yazen Ghannam <Yazen.Ghannam@amd.com>
---
 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

             reply	other threads:[~2016-08-31 21:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 20:21 Yazen Ghannam [this message]
2016-09-02  8:41 ` Thomas Gleixner
2016-09-02 12:57   ` Ghannam, Yazen
2016-09-02 13:13     ` Thomas Gleixner
2016-09-02 16:28       ` Ghannam, Yazen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472674900-60688-1-git-send-email-Yazen.Ghannam@amd.com \
    --to=yazen.ghannam@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®