RAS: AMD severities grading
Borislav Petkov
maintainerHi Ingo,
this is ontop of tip/x86/ras. Please pull,
Thanks.
The following changes since commit c9ce8712838e48bf356144122c5ecdcdac5d1829:
x86/mce: Reindent __mcheck_cpu_apply_quirks() properly (2015-03-23 10:16:44 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git tags/amd_severity
for you to fetch changes up to 43eaa2a1ad70d72876cdbb2eb5450a2665e4770f:
x86/mce: Define mce_severity function pointer (2015-03-24 12:14:15 +0100)
----------------------------------------------------------------
This has been long in the making - an AMD-specific MCE-severity grading function. And it is actually readable at a quick glance. Further error recovery actions will be based on its output.
Patches tested on every relevant AMD family out there.
----------------------------------------------------------------
Aravind Gopalakrishnan (2):
x86/mce: Add an AMD severities-grading function x86/mce: Define mce_severity function pointer
arch/x86/include/asm/mce.h | 8 ++++ arch/x86/kernel/cpu/mcheck/mce-internal.h | 2 +- arch/x86/kernel/cpu/mcheck/mce-severity.c | 67 ++++++++++++++++++++++++++++++- arch/x86/kernel/cpu/mcheck/mce.c | 10 +++++ 4 files changed, 85 insertions(+), 2 deletions(-)
arch/x86/include/asm/mce.h +8 -0
@@ -116,6 +116,12 @@ struct mca_config {u32 rip_msr; }; +struct mce_vendor_flags { +__u64 overflow_recov :1 ,/* cpuid_ebx(80000007) */ + __reserved_0 :63 ; +}; +extern struct mce_vendor_flags mce_flags; +extern struct mca_config mca_cfg;extern void mce_register_decode_chain (struct notifier_block *nb);extern void mce_unregister_decode_chain (struct notifier_block *nb);
@@ -128,9 +134,11 @@ extern int mce_p5_enabled;#ifdef CONFIG_X86_MCE int mcheck_init (void );void mcheck_cpu_init (struct cpuinfo_x86 *c); +void mcheck_vendor_init_severity (void );#else static inline int mcheck_init (void ) {return 0 ; }static inline void mcheck_cpu_init (struct cpuinfo_x86 *c) {} +static inline void mcheck_vendor_init_severity (void ) {}#endif #ifdef CONFIG_X86_ANCIENT_MCE
arch/x86/kernel/cpu/mcheck/mce-internal.h +1 -1
@@ -24,7 +24,7 @@ struct mce_bank {char attrname[ATTR_LEN ];/* attribute name */ }; -int mce_severity (struct mce *a,int tolerant,char **msg,bool is_excp); +extern int (*mce_severity)(struct mce *a,int tolerant,char **msg,bool is_excp);struct dentry *mce_get_debugfs_dir (void );extern struct mce_bank *mce_banks;
arch/x86/kernel/cpu/mcheck/mce-severity.c +66 -1
79 lines not on this page · raw message
arch/x86/kernel/cpu/mcheck/mce.c +10 -0
@@ -64,6 +64,7 @@ static DEFINE_MUTEX(mce_chrdev_read_mutex);DEFINE_PER_CPU (unsigned, mce_exception_count);struct mce_bank *mce_banks__read_mostly ; +struct mce_vendor_flags mce_flags__read_mostly ;struct mca_config mca_cfg__read_mostly = { .bootlog =-1 ,
@@ -1535,6 +1536,13 @@ static int __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c) mce_banks[0 ].ctl =0 ;/* +* overflow_recov is supported for F15h Models 00h-0fh +* even though we don't have a CPUID bit for it. +*/ +if (c->x86 ==0x15 && c->x86_model <=0xf ) + mce_flags.overflow_recov =1 ; + +/* * Turn off MC4_MISC thresholding banks on those models since * they're not supported there. */
@@ -1633,6 +1641,7 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)break ;case X86_VENDOR_AMD :mce_amd_feature_init (c); + mce_flags.overflow_recov =cpuid_ebx (0x80000007 ) &0x1 ;break ;default :break ;
@@ -2017,6 +2026,7 @@ __setup("mce", mcheck_enable);int __init mcheck_init (void ) {mcheck_intel_therm_init (); +mcheck_vendor_init_severity ();return 0 ; }
Signature · 5 lines
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
--Quoted 30 lines · Borislav Petkov
Hi Ingo,
this is ontop of tip/x86/ras. Please pull,
Thanks.
The following changes since commit
c9ce8712838e48bf356144122c5ecdcdac5d1829:x86/mce: Reindent
__mcheck_cpu_apply_quirks()properly (2015-03-23 10:16:44 +0100)are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.gittags/amd_severityfor you to fetch changes up to
43eaa2a1ad70d72876cdbb2eb5450a2665e4770f:x86/mce: Define
mce_severityfunction pointer (2015-03-24 12:14:15 +0100)----------------------------------------------------------------
This has been long in the making - an AMD-specific MCE-severity grading function. And it is actually readable at a quick glance. Further error recovery actions will be based on its output.Patches tested on every relevant AMD family out there.
----------------------------------------------------------------
Aravind Gopalakrishnan (2):
x86/mce: Add an AMD severities-grading function x86/mce: Definemce_severityfunction pointer
Quoted 5 lines
arch/x86/include/asm/mce.h | 8 ++++ arch/x86/kernel/cpu/mcheck/mce-internal.h | 2 +- arch/x86/kernel/cpu/mcheck/mce-severity.c | 67 ++++++++++++++++++++++++++++++- arch/x86/kernel/cpu/mcheck/mce.c | 10 +++++ 4 files changed, 85 insertions(+), 2 deletions(-)
Pulled, thanks Boris!
Ingo