Skip to contentSkip to conversation

powerpc: Handle MCE on POWER9 with only DSISR bit 33 set

PATCH Applied Michael Neuling 3 participants 3 messages Sep 22, 2017 – Sep 26, 2017 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 powerpc: Handle MCE on POWER9 with only DSISR bit 33 set

On POWER9 DD2.1 and below, it's possible for a paste instruction to cause a Machine Check Exception (MCE) where only DSISR bit 33 is set. This will result in the MCE handler seeing an unknown event, which triggers linux to crash.

We change this by detecting unknown events caused by load/stores in the MCE handler and marking them as handled so that we no longer crash.

An MCE that occurs like this is spurious, so we don't need to do anything in terms of servicing it. If there is something that needs to be serviced, the CPU will raise the MCE again with the correct DSISR so that it can be serviced properly.

--
v3: Simplification and SRR1 check suggestions from Nick
v2: update commit message based on Balbir's comments

---
 arch/powerpc/kernel/mce_power.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/powerpc/kernel/mce_power.c +10 -0
index b76ca198e0..e423cf0e43 100644
@@ -624,5 +624,15 @@ long __machine_check_early_realmode_p8(struct pt_regs *regs)
 
 long __machine_check_early_realmode_p9(struct pt_regs *regs)
 {
+	/*
+	 * On POWER9 DD2.1 and below, it's possible to get machine
+	 * check caused by a paste instruction where only DSISR bit 33
+	 * is set. This will result in the MCE handler seeing an
+	 * unknown event and us crashing.  Change this to mark as
+	 * handled.
+	 */
+	if (SRR1_MC_LOADSTORE(regs->msr) && regs->dsisr == 0x40000000)
+		return 1;
+
 	return mce_handle_error(regs, mce_p9_derror_table, mce_p9_ierror_table);
 }
Signature · 1 line
2.11.0
Acked-by on v3 1/1
#1 lore raw
Quoted 31 lines · Michael Neuling

On POWER9 DD2.1 and below, it's possible for a paste instruction to cause a Machine Check Exception (MCE) where only DSISR bit 33 is set. This will result in the MCE handler seeing an unknown event, which triggers linux to crash.

We change this by detecting unknown events caused by load/stores in the MCE handler and marking them as handled so that we no longer crash.

An MCE that occurs like this is spurious, so we don't need to do anything in terms of servicing it. If there is something that needs to be serviced, the CPU will raise the MCE again with the correct DSISR so that it can be serviced properly.

--
v3: Simplification and SRR1 check suggestions from Nick
v2: update commit message based on Balbir's comments

---
 arch/powerpc/kernel/mce_power.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/powerpc/kernel/mce_power.c +0 -0
index b76ca198e0..e423cf0e43 100644
@@ -624,5 +624,15 @@ long __machine_check_early_realmode_p8(struct pt_regs *regs)
 
 long __machine_check_early_realmode_p9(struct pt_regs *regs)
 {

arch/powerpc/kernel/mce_power.c long __machine_check_early_realmode_p8(struct pt_regs *regs) · line 636

Quoted 10 lines
arch/powerpc/kernel/mce_power.c +10 -0
+       /*
+        * On POWER9 DD2.1 and below, it's possible to get machine
+        * check caused by a paste instruction where only DSISR bit 33
+        * is set. This will result in the MCE handler seeing an
+        * unknown event and us crashing.  Change this to mark as
+        * handled.
+        */
+       if (SRR1_MC_LOADSTORE(regs->msr) && regs->dsisr == 0x40000000)
+               return 1;
+
#2 lore raw
In reply to Michael Neuling
Quoted 9 lines · Michael Neuling

On POWER9 DD2.1 and below, it's possible for a paste instruction to cause a Machine Check Exception (MCE) where only DSISR bit 33 is set. This will result in the MCE handler seeing an unknown event, which triggers linux to crash.

We change this by detecting unknown events caused by load/stores in the MCE handler and marking them as handled so that we no longer crash.

Quoted 8 lines

An MCE that occurs like this is spurious, so we don't need to do anything in terms of servicing it. If there is something that needs to be serviced, the CPU will raise the MCE again with the correct DSISR so that it can be serviced properly.

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/d8bd9f3f0925d22726de159531bfe3

cheers