Skip to contentSkip to conversation

x86, mce, amd: Read mcgstatus before we log the error

PATCH In review Aravind Gopalakrishnan 2 participants 3 messages May 13, 2015 – May 14, 2015 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86, mce, amd: Read mcgstatus before we log the error

Code to read mcgstatus was introduced with patch 44612a3ac. However, that seems to have been accidentally removed in a3a529d10. Adding that back here.

---
 arch/x86/kernel/cpu/mcheck/mce_amd.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/cpu/mcheck/mce_amd.c +1 -0
index e99b150..7edfa4c 100644
@@ -319,6 +319,7 @@ static void __log_error(unsigned int bank, bool threshold_err, u64 misc)
 		return;
 
 	mce_setup(&m);
+	rdmsrl(MSR_IA32_MCG_STATUS, m.mcgstatus);
 
 	m.status = status;
 	m.bank = bank;
Signature · 1 line
2.4.0
maintainer
#1 lore raw
Quoted 14 lines · Aravind Gopalakrishnan

Code to read mcgstatus was introduced with patch 44612a3ac. However, that seems to have been accidentally removed in a3a529d10. Adding that back here.

---
 arch/x86/kernel/cpu/mcheck/mce_amd.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/cpu/mcheck/mce_amd.c +0 -0
index e99b150..7edfa4c 100644

arch/x86/kernel/cpu/mcheck/mce_amd.c static void __log_error(unsigned int bank, bool threshold_err, u64 misc) · line 322

Quoted 4 lines
arch/x86/kernel/cpu/mcheck/mce_amd.c +1 -0
@@ -319,6 +319,7 @@ static void __log_error(unsigned int bank, bool threshold_err, u64 misc)
 		return;
 
 	mce_setup(&m);
+	rdmsrl(MSR_IA32_MCG_STATUS, m.mcgstatus);

Any meaningful bits in that MSR we wanna know when getting a thresholding or deferred error? Are they even defined?

If yes, RIPV should always be 1b, EIPV too, MCIP can't be set.

-ENOMOREUSEFULBITS.

Signature · 5 lines
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
#2 lore raw
Quoted 6 lines · Borislav Petkov

arch/x86/kernel/cpu/mcheck/mce_amd.c static void __log_error(unsigned int bank, bool threshold_err, u64 misc) · line 322

Quoted 3 lines · Aravind Gopalakrishnan
  
  	mce_setup(&m);
arch/x86/kernel/cpu/mcheck/mce_amd.c +1 -0
+	rdmsrl(MSR_IA32_MCG_STATUS, m.mcgstatus);

Any meaningful bits in that MSR we wanna know when getting a thresholding or deferred error? Are they even defined?

Ah. Good point. RIPV is not defined for Deferred errors.
For thresholding, we'll hit the interrupt handler only if we hit the threshold and it is not UC error (for which RIPV is not defined). Else, the counter would be incremented, but it would cause a #MC anyway.

Quoted 4 lines

If yes, RIPV should always be 1b, EIPV too, MCIP can't be set.

-ENOMOREUSEFULBITS.

Thanks,
-Aravind.