From: Michael Neuling <mikey@neuling.org>
To: mpe@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org, mikey@neuling.org,
benh@kernel.crashing.org
Subject: [PATCH 2/2] powerpc: Handle MCE on POWER9 with only DSISR bit 33 set
Date: Fri, 15 Sep 2017 15:25:49 +1000 [thread overview]
Message-ID: <20170915052549.8105-2-mikey@neuling.org> (raw)
In-Reply-To: <20170915052549.8105-1-mikey@neuling.org>
On POWER9 DD2.1 and below, it's possible to get Machine Check
Exception (MCE) where only DSISR bit 33 is set. This will result in
the linux MCE handler seeing an unknown event, which triggers linux to
crash.
We change this by detecting unknown events in the MCE handler and
marking them as handled so that we no longer crash. We do this only on
chip revisions known to have this problem.
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
arch/powerpc/kernel/mce_power.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/powerpc/kernel/mce_power.c b/arch/powerpc/kernel/mce_power.c
index b76ca198e0..72ec667136 100644
--- a/arch/powerpc/kernel/mce_power.c
+++ b/arch/powerpc/kernel/mce_power.c
@@ -595,6 +595,7 @@ static long mce_handle_error(struct pt_regs *regs,
uint64_t addr;
uint64_t srr1 = regs->msr;
long handled;
+ unsigned long pvr;
if (SRR1_MC_LOADSTORE(srr1))
handled = mce_handle_derror(regs, dtable, &mce_err, &addr);
@@ -604,6 +605,20 @@ static long mce_handle_error(struct pt_regs *regs,
if (!handled && mce_err.error_type == MCE_ERROR_TYPE_UE)
handled = mce_handle_ue_error(regs);
+ /*
+ * On POWER9 DD2.1 and below, it's possible to get machine
+ * check 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 on these revisions.
+ */
+ pvr = mfspr(SPRN_PVR);
+ if (((PVR_VER(pvr) == PVR_POWER9) &&
+ (PVR_CFG(pvr) == 2) &&
+ (PVR_MIN(pvr) <= 1)) || cpu_has_feature(CPU_FTR_POWER9_DD1))
+ /* DD2.1 and below */
+ if (mce_err.error_type == MCE_ERROR_TYPE_UNKNOWN)
+ handled = 1;
+
save_mce_event(regs, handled, &mce_err, regs->nip, addr);
return handled;
--
2.11.0
next prev parent reply other threads:[~2017-09-15 5:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-15 5:25 [PATCH 1/2] powerpc: Add workaround for P9 vector CI load issue Michael Neuling
2017-09-15 5:25 ` Michael Neuling [this message]
2017-09-19 10:13 ` [PATCH 2/2] powerpc: Handle MCE on POWER9 with only DSISR bit 33 set Balbir Singh
2017-09-21 1:50 ` Michael Neuling
2017-09-20 11:43 ` Michael Ellerman
2017-09-27 10:32 ` [1/2] powerpc: Add workaround for P9 vector CI load issue Michael Ellerman
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=20170915052549.8105-2-mikey@neuling.org \
--to=mikey@neuling.org \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).