Re: [PATCH v5 5/7] powerpc/pseries: flush SLB contents on SLB MCE errors.
flat view
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2018-07-19 13:08:03
Michal Such=C3=A1nek [off-list ref] writes:
On Tue, 3 Jul 2018 08:08:14 +1000 "Nicholas Piggin" [off-list ref] wrote: >> On Mon, 02 Jul 2018 11:17=
:06 +0530
quoted
Mahesh J Salgaonkar [off-list ref] wrote:quoted
From: Mahesh Salgaonkar <redacted>diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c index efdd16a79075..221271c96a57 100644 --- a/arch/powerpc/kernel/mce.c +++ b/arch/powerpc/kernel/mce.c@@ -488,9 +488,21 @@ long machine_check_early(struct pt_regs *regs) { long handled =3D 0;=20=20 - __this_cpu_inc(irq_stat.mce_exceptions); + /* + * For pSeries we count mce when we go into virtual mode machine + * check handler. Hence skip it. Also, We can't access per cpu + * variables in real mode for LPAR. + */ + if (early_cpu_has_feature(CPU_FTR_HVMODE)) + __this_cpu_inc(irq_stat.mce_exceptions); =20=20 - if (cur_cpu_spec && cur_cpu_spec->machine_check_early) + /* + * See if platform is capable of handling machine check. + * Otherwise fallthrough and allow CPU to handle this machine check. + */ + if (ppc_md.machine_check_early) + handled =3D ppc_md.machine_check_early(regs); + else if (cur_cpu_spec && cur_cpu_spec->machine_check_early) handled =3D cur_cpu_spec->machine_check_early(regs);=20=20=20 Would be good to add a powernv ppc_md handler which does the cur_cpu_spec->machine_check_early() call now that other platforms are calling this code. Because those aren't valid as a fallback call, but specific to powernv. =20Something like this (untested)? Subject: [PATCH] powerpc/powernv: define platform MCE handler.
LGTM. cheers