mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Yinghai Lu <yinghai@kernel.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	gorcunov@openvz.org, yinghai@kernel.org,
	andreas.herrmann3@amd.com, suresh.b.siddha@intel.com,
	tglx@linutronix.de, mingo@elte.hu
Subject: [tip:x86/cpu] x86: Use hard_smp_processor_id() to get apic id for AMD K8 cpus
Date: Fri, 4 Sep 2009 07:59:22 GMT	[thread overview]
Message-ID: <tip-0d96b9ff748b5f57d6f1d6d21209f5745245aadc@git.kernel.org> (raw)
In-Reply-To: <4A998CCA.1040407@kernel.org>

Commit-ID:  0d96b9ff748b5f57d6f1d6d21209f5745245aadc
Gitweb:     http://git.kernel.org/tip/0d96b9ff748b5f57d6f1d6d21209f5745245aadc
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Sat, 29 Aug 2009 13:17:14 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 4 Sep 2009 09:55:29 +0200

x86: Use hard_smp_processor_id() to get apic id for AMD K8 cpus

Otherwise, system with apci id lifting will have wrong apicid in
/proc/cpuinfo.

and use that in srat_detect_node().

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
LKML-Reference: <4A998CCA.1040407@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/kernel/cpu/amd.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index a76d2c1..e1600c7 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -336,7 +336,7 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
 #if defined(CONFIG_NUMA) && defined(CONFIG_X86_64)
 	int cpu = smp_processor_id();
 	int node;
-	unsigned apicid = cpu_has_apic ? hard_smp_processor_id() : c->apicid;
+	unsigned apicid = c->apicid;
 
 	node = per_cpu(cpu_llc_id, cpu);
 
@@ -481,6 +481,9 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 	}
 	if (c->x86 == 0x10 || c->x86 == 0x11)
 		set_cpu_cap(c, X86_FEATURE_REP_GOOD);
+
+	/* get apicid instead of initial apic id from cpuid */
+	c->apicid = hard_smp_processor_id();
 #else
 
 	/*

      reply	other threads:[~2009-09-04  7:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-25  7:25 [PATCH] x86: use hard_smp_processor_id to get apic id in identify_cpu Yinghai Lu
2009-08-25 19:51 ` [PATCH] x86: use c->apicid directly in srat_detect_node Yinghai Lu
2009-08-25 22:06 ` [PATCH] x86: use hard_smp_processor_id to get apic id in identify_cpu -v2 Yinghai Lu
2009-08-25 22:53   ` Suresh Siddha
2009-08-26  1:14     ` Yinghai Lu
2009-08-26 17:49       ` Suresh Siddha
2009-08-26 19:07         ` Yinghai Lu
2009-08-26 22:24           ` Suresh Siddha
2009-08-29 20:17             ` [PATCH] x86: use hard_smp_processor_id to get apic id for amd k8 cpus Yinghai Lu
2009-09-04  7:59               ` tip-bot for Yinghai Lu [this message]

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=tip-0d96b9ff748b5f57d6f1d6d21209f5745245aadc@git.kernel.org \
    --to=yinghai@kernel.org \
    --cc=andreas.herrmann3@amd.com \
    --cc=gorcunov@openvz.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome