linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: mark gross <mgross@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>,
	linux-edac <linux-edac@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Yazen Ghannam <Yazen.Ghannam@amd.com>, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH 0/7] EDAC, mce_amd: Issue decoded MCE through the tracepoint
Date: Thu, 31 Aug 2017 21:17:54 +0200	[thread overview]
Message-ID: <20170831191754.4nnv35lpugvel3ni@pd.tnic> (raw)
In-Reply-To: <20170830220254.g7xcwosgj2hcki4n@pd.tnic>

On Thu, Aug 31, 2017 at 12:02:54AM +0200, Borislav Petkov wrote:
> Yeah, it is a bit ad-hoc. I guess I can add an arch_has_decoder()
> wrapper which each arch can define. That would be cleaner.

Something like this, I guess (ontop):

---
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 67f951f0c840..b4855edac729 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -388,4 +388,6 @@ static inline int mce_threshold_remove_device(unsigned int cpu) { return 0; };
 
 #endif
 
+#define ras_arch_has_decoder ras_arch_has_decoder
+bool ras_arch_has_decoder(void);
 #endif /* _ASM_X86_MCE_H */
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 3ecc2b2db8f3..6414fa70fd42 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -182,6 +182,12 @@ void mce_unregister_decode_chain(struct notifier_block *nb)
 }
 EXPORT_SYMBOL_GPL(mce_unregister_decode_chain);
 
+bool ras_arch_has_decoder(void)
+{
+	return mca_cfg.has_decoder;
+}
+EXPORT_SYMBOL_GPL(ras_arch_has_decoder);
+
 static inline u32 ctl_reg(int bank)
 {
 	return MSR_IA32_MCx_CTL(bank);
diff --git a/drivers/ras/debugfs.c b/drivers/ras/debugfs.c
index 62d3da9d256f..b368e8ae4738 100644
--- a/drivers/ras/debugfs.c
+++ b/drivers/ras/debugfs.c
@@ -1,6 +1,6 @@
 #include <linux/debugfs.h>
 
-#include "../../arch/x86/kernel/cpu/mcheck/mce-internal.h"
+#include <asm/mce.h>
 
 struct dentry *ras_debugfs_dir;
 
@@ -15,7 +15,7 @@ EXPORT_SYMBOL_GPL(ras_userspace_consumers);
 static int trace_show(struct seq_file *m, void *v)
 {
 	seq_printf(m, "readers:%d\n", atomic_read(&trace_count));
-	seq_printf(m, "has decoder:%d\n", mca_cfg.has_decoder);
+	seq_printf(m, "has decoder:%d\n", ras_arch_has_decoder());
 	return 0;
 }
 
diff --git a/drivers/ras/debugfs.h b/drivers/ras/debugfs.h
index db72e4513191..9c75c4c5b84d 100644
--- a/drivers/ras/debugfs.h
+++ b/drivers/ras/debugfs.h
@@ -5,4 +5,9 @@
 
 extern struct dentry *ras_debugfs_dir;
 
+#ifndef ras_arch_has_decoder
+#define ras_arch_has_decoder ras_arch_has_decoder
+static inline bool ras_arch_has_decoder(void)	{ return false; }
+#endif
+
 #endif /* __RAS_DEBUGFS_H__ */

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

  reply	other threads:[~2017-08-31 19:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25 10:24 [PATCH 0/7] EDAC, mce_amd: Issue decoded MCE through the tracepoint Borislav Petkov
2017-08-25 10:24 ` [PATCH 1/7] x86/mce: Handle an in-kernel MCE decoder Borislav Petkov
2017-08-25 10:24 ` [PATCH 2/7] x86/mce: Extend the MCE tracepoint with a decoded string Borislav Petkov
2017-08-25 10:24 ` [PATCH 3/7] seq_buf: Add seq_buf_clear_buf() Borislav Petkov
2017-08-25 10:24 ` [PATCH 4/7] seq_buf: Export seq_buf_printf() to modules Borislav Petkov
2017-08-25 13:27   ` Steven Rostedt
2017-08-25 10:24 ` [PATCH 5/7] EDAC, mce_amd: Convert to seq_buf Borislav Petkov
2017-08-25 13:30   ` Steven Rostedt
2017-08-25 10:24 ` [PATCH 6/7] EDAC, mce_amd: Issue the decoded info through the TP or printk() Borislav Petkov
2017-08-25 13:33   ` Steven Rostedt
2017-08-25 10:24 ` [PATCH 7/7] x86/mce: Issue the mcelog --ascii message on !AMD Borislav Petkov
2017-08-28 13:45 ` [PATCH 0/7] EDAC, mce_amd: Issue decoded MCE through the tracepoint Borislav Petkov
2017-08-30 11:48   ` Borislav Petkov
2017-08-30 21:47     ` mark gross
2017-08-30 22:02       ` Borislav Petkov
2017-08-31 19:17         ` Borislav Petkov [this message]
2017-08-30 23:30       ` Steven Rostedt
2017-09-03 23:37         ` mark gross
2017-09-04 10:47           ` 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=20170831191754.4nnv35lpugvel3ni@pd.tnic \
    --to=bp@alien8.de \
    --cc=Yazen.Ghannam@amd.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mgross@linux.intel.com \
    --cc=rostedt@goodmis.org \
    --cc=tony.luck@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).