From: Borislav Petkov <borislav.petkov@amd.com>
To: <torvalds@linux-foundation.org>
Cc: <norsk5@yahoo.com>, <linux-kernel@vger.kernel.org>,
<x86@kernel.org>, Andreas Herrmann <andreas.herrmann3@amd.com>,
Borislav Petkov <borislav.petkov@amd.com>
Subject: [PATCH 2/5] x86, EDAC: Provide function to return NodeId of a CPU
Date: Wed, 16 Sep 2009 15:50:47 +0200 [thread overview]
Message-ID: <1253109050-31165-3-git-send-email-borislav.petkov@amd.com> (raw)
In-Reply-To: <1253109050-31165-1-git-send-email-borislav.petkov@amd.com>
From: Andreas Herrmann <andreas.herrmann3@amd.com>
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>
---
arch/x86/include/asm/processor.h | 2 ++
arch/x86/kernel/cpu/amd.c | 10 ++++++++++
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 e08ea04..42a3f93 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,
extern int get_tsc_mode(unsigned long adr);
extern int set_tsc_mode(unsigned int val);
+extern int amd_get_nb_id(int cpu);
+
#endif /* _ASM_X86_PROCESSOR_H */
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 22a47c8..f32fa71 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)
#endif
}
+int amd_get_nb_id(int cpu)
+{
+ int id = 0;
+#ifdef CONFIG_SMP
+ id = per_cpu(cpu_llc_id, cpu);
+#endif
+ return id;
+}
+EXPORT_SYMBOL_GPL(amd_get_nb_id);
+
static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
{
#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 c8ca713..0c21c37 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)
regs.nbsh = (u32)(m->status >> 32);
regs.nbeal = (u32) m->addr;
regs.nbeah = (u32)(m->addr >> 32);
- node = per_cpu(cpu_llc_id, m->extcpu);
+ node = amd_get_nb_id(m->extcpu);
amd_decode_nb_mce(node, ®s, 1);
break;
--
1.6.3.3
next prev parent reply other threads:[~2009-09-16 13:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-16 13:50 [GIT PULL] AMD64 EDAC updates, p2 Borislav Petkov
2009-09-16 13:50 ` [PATCH 1/5] amd64_edac: build driver only on AMD hardware Borislav Petkov
2009-09-16 13:50 ` Borislav Petkov [this message]
2009-09-16 13:50 ` [PATCH 3/5] amd64_edac: cleanup amd64_check_ecc_enabled Borislav Petkov
2009-09-16 13:50 ` [PATCH 4/5] amd64_edac: Rewrite unganged mode code of f10_early_channel_count Borislav Petkov
2009-09-16 13:50 ` [PATCH 5/5] amd64_edac: check NB MCE bank enable on the current node properly Borislav Petkov
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=1253109050-31165-3-git-send-email-borislav.petkov@amd.com \
--to=borislav.petkov@amd.com \
--cc=andreas.herrmann3@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=norsk5@yahoo.com \
--cc=torvalds@linux-foundation.org \
--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®