Michal Suchánek <msucha...@suse.de> writes:
> On Tue, 3 Jul 2018 08:08:14 +1000
> "Nicholas Piggin" <npig...@gmail.com> wrote: >> On Mon, 02 Jul 2018 11:17:06 
> +0530
>> Mahesh J Salgaonkar <mah...@linux.vnet.ibm.com> wrote:
>> > From: Mahesh Salgaonkar <mah...@linux.vnet.ibm.com>
>> > 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 = 0;
>> >  
>> > -  __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);
>> >  
>> > -  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 = ppc_md.machine_check_early(regs);
>> > +  else if (cur_cpu_spec && cur_cpu_spec->machine_check_early)
>> >            handled =
>> > cur_cpu_spec->machine_check_early(regs);  
>> 
>> 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.
>> 
>
> Something like this (untested)?
>
> Subject: [PATCH] powerpc/powernv: define platform MCE handler.

LGTM.

cheers

Reply via email to