diff options
author | Andreas Herrmann <andreas.herrmann3@amd.com> | 2009-09-16 05:33:40 -0400 |
---|---|---|
committer | Borislav Petkov <borislav.petkov@amd.com> | 2009-09-16 05:33:40 -0400 |
commit | 6a8126911a5ab167783fce18ae9cc70ec9b84fe2 (patch) | |
tree | 9ebf91277ff7d99861ee87379f5fc8252f24f33a | |
parent | b9183f9b99a9bd3349aefbd51d22f7e1bdc4a087 (diff) |
x86, EDAC: Provide function to return NodeId of a CPU
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | arch/x86/include/asm/processor.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/amd.c | 10 | ||||
-rw-r--r-- | drivers/edac/edac_mce_amd.c | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index e08ea043e085..42a3f936dadc 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -1020,4 +1020,6 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip, | |||
1020 | extern int get_tsc_mode(unsigned long adr); | 1020 | extern int get_tsc_mode(unsigned long adr); |
1021 | extern int set_tsc_mode(unsigned int val); | 1021 | extern int set_tsc_mode(unsigned int val); |
1022 | 1022 | ||
1023 | extern int amd_get_nb_id(int cpu); | ||
1024 | |||
1023 | #endif /* _ASM_X86_PROCESSOR_H */ | 1025 | #endif /* _ASM_X86_PROCESSOR_H */ |
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 22a47c82f3c0..f32fa71ccf97 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -333,6 +333,16 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c) | |||
333 | #endif | 333 | #endif |
334 | } | 334 | } |
335 | 335 | ||
336 | int amd_get_nb_id(int cpu) | ||
337 | { | ||
338 | int id = 0; | ||
339 | #ifdef CONFIG_SMP | ||
340 | id = per_cpu(cpu_llc_id, cpu); | ||
341 | #endif | ||
342 | return id; | ||
343 | } | ||
344 | EXPORT_SYMBOL_GPL(amd_get_nb_id); | ||
345 | |||
336 | static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) | 346 | static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c) |
337 | { | 347 | { |
338 | #if defined(CONFIG_NUMA) && defined(CONFIG_X86_64) | 348 | #if defined(CONFIG_NUMA) && defined(CONFIG_X86_64) |
diff --git a/drivers/edac/edac_mce_amd.c b/drivers/edac/edac_mce_amd.c index c8ca7136dacc..0c21c370c9dd 100644 --- a/drivers/edac/edac_mce_amd.c +++ b/drivers/edac/edac_mce_amd.c | |||
@@ -405,7 +405,7 @@ void decode_mce(struct mce *m) | |||
405 | regs.nbsh = (u32)(m->status >> 32); | 405 | regs.nbsh = (u32)(m->status >> 32); |
406 | regs.nbeal = (u32) m->addr; | 406 | regs.nbeal = (u32) m->addr; |
407 | regs.nbeah = (u32)(m->addr >> 32); | 407 | regs.nbeah = (u32)(m->addr >> 32); |
408 | node = per_cpu(cpu_llc_id, m->extcpu); | 408 | node = amd_get_nb_id(m->extcpu); |
409 | 409 | ||
410 | amd_decode_nb_mce(node, ®s, 1); | 410 | amd_decode_nb_mce(node, ®s, 1); |
411 | break; | 411 | break; |