lkml.org 
[lkml]   [2015]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] x86, ras: Extend machine check recovery code to annotated ring0 areas
On Tue, Nov 10, 2015 at 12:21:42PM +0100, Borislav Petkov wrote:
> You could save a precious indentation level here:
>
> if (cfg->tolerant == 3)
> goto clear;
>
> and add the "clear" label below.
>
> clear:
> if (worst > 0)
> mce_report_event(regs);
> mce_wrmsrl(MSR_IA32_MCG_STATUS, 0)
>
> > if (no_way_out)
> > mce_panic("Fatal machine check on current CPU", &m, msg);
> > if (worst == MCE_AR_SEVERITY) {
> > - recover_paddr = m.addr;
> > - if (!(m.mcgstatus & MCG_STATUS_RIPV))
> > - flags |= MF_MUST_KILL;
> > + if ((m.cs & 3) == 3) {
> > + recover_paddr = m.addr;
> > + if (!(m.mcgstatus & MCG_STATUS_RIPV))
> > + flags |= MF_MUST_KILL;
> > + } else if (fixup_mcexception(regs)) {
> > + regs->ax = BIT(63) | m.addr;
> > + } else
> > + mce_panic("Failed kernel mode recovery",
> > + &m, NULL);
> > } else if (kill_it) {
> > force_sig(SIGBUS, current);
> > }

That would be tidier ... the inside of the "if" has been gradually growing
with added recovery paths. I had to fold the mce_panic() line to shut
checkpatch up.

But I'm not really sure what tolerant==3 people really want here. By skipping
the recovery code they doom themselves to hitting the machine check again.

-Tony


\
 
 \ /
  Last update: 2015-11-10 23:21    [W:0.102 / U:2.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site