From: Yinghai Lu <yhlu.kernel@gmail.com>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Yinghai Lu <yhlu.kernel@gmail.com>
Subject: [PATCH 3/9] x86: add srat_detect_node for amd64
Date: Sun, 7 Sep 2008 17:58:52 -0700 [thread overview]
Message-ID: <1220835538-18280-3-git-send-email-yhlu.kernel@gmail.com> (raw)
In-Reply-To: <1220835538-18280-1-git-send-email-yhlu.kernel@gmail.com>
seperate that from amd_detect_cmp()
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
---
arch/x86/kernel/cpu/amd_64.c | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/cpu/amd_64.c b/arch/x86/kernel/cpu/amd_64.c
index 466a1ea..20c3f12 100644
--- a/arch/x86/kernel/cpu/amd_64.c
+++ b/arch/x86/kernel/cpu/amd_64.c
@@ -36,19 +36,23 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
{
#ifdef CONFIG_SMP
unsigned bits;
-#ifdef CONFIG_NUMA
- int cpu = smp_processor_id();
- int node = 0;
- unsigned apicid = hard_smp_processor_id();
-#endif
+
bits = c->x86_coreid_bits;
/* Low order bits define the core id (index of core in socket) */
c->cpu_core_id = c->initial_apicid & ((1 << bits)-1);
/* Convert the initial APIC ID into the socket ID */
c->phys_proc_id = c->initial_apicid >> bits;
+#endif
+}
+static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
+{
#ifdef CONFIG_NUMA
+ int cpu = smp_processor_id();
+ int node;
+ unsigned apicid = hard_smp_processor_id();
+
node = c->phys_proc_id;
if (apicid_to_node[apicid] != NUMA_NO_NODE)
node = apicid_to_node[apicid];
@@ -76,7 +80,6 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
printk(KERN_INFO "CPU %d/%x -> Node %d\n", cpu, apicid, node);
#endif
-#endif
}
static void __cpuinit early_init_amd_mc(struct cpuinfo_x86 *c)
@@ -169,8 +172,10 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
display_cacheinfo(c);
/* Multi core CPU? */
- if (c->extended_cpuid_level >= 0x80000008)
+ if (c->extended_cpuid_level >= 0x80000008) {
amd_detect_cmp(c);
+ srat_detect_node(c);
+ }
if (c->extended_cpuid_level >= 0x80000006) {
if ((c->x86 >= 0x0f) && (cpuid_edx(0x80000006) & 0xf000))
--
1.5.4.5
next prev parent reply other threads:[~2008-09-08 0:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-08 0:58 [PATCH 1/9] x86: cpu make amd.c more like amd_64.c v2 Yinghai Lu
2008-09-08 0:58 ` [PATCH 2/9] x86: remove duplicated force_mwait Yinghai Lu
2008-09-08 0:58 ` Yinghai Lu [this message]
2008-09-08 0:58 ` [PATCH 4/9] x86: merge header in amd/64.c Yinghai Lu
2008-09-08 0:58 ` [PATCH 5/9] x86: make amd.c have 64bit support code Yinghai Lu
2008-09-08 0:58 ` [PATCH 6/9] x86: make amd_64 have 32 bit code Yinghai Lu
2008-09-08 0:58 ` [PATCH 7/9] x86: make 64 bit to use amd.c Yinghai Lu
2008-09-08 13:33 ` Ingo Molnar
2008-09-08 0:58 ` [PATCH 8/9] x86: lapic address print out like io apic addr Yinghai Lu
2008-09-08 13:45 ` Ingo Molnar
2008-09-08 0:58 ` [PATCH 9/9] x86: little clean up intel.c/intel_64.c Yinghai Lu
2008-09-08 13:46 ` Ingo Molnar
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=1220835538-18280-3-git-send-email-yhlu.kernel@gmail.com \
--to=yhlu.kernel@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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