x86/mce: Move the mce_panic() call and 'kill_it' assignments to the right places
authorGabriele Paoloni <gabriele.paoloni@intel.com>
Fri, 27 Nov 2020 16:18:16 +0000 (16:18 +0000)
committerBorislav Petkov <bp@suse.de>
Tue, 1 Dec 2020 17:45:56 +0000 (18:45 +0100)
commite273e6e12ab1db3eb57712bd60655744d0091fa3
treef63cb913895ed66984dd6f9e5528ee45398a9cc0
parent15936ca13dac032a3f4e6b4ba78add3880bddcf3
x86/mce: Move the mce_panic() call and 'kill_it' assignments to the right places

Right now, for local MCEs the machine calls panic(), if needed, right
after lmce is set. For MCE broadcasting, mce_reign() takes care of
calling mce_panic().

Hence:
- improve readability by moving the conditional evaluation of
tolerant up to when kill_it is set first;
- move the mce_panic() call up into the statement where mce_end()
fails.

 [ bp: Massage, remove comment in the mce_end() failure case because it
   is superfluous; use local ptr 'cfg' in both tests. ]

Signed-off-by: Gabriele Paoloni <gabriele.paoloni@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Link: https://lkml.kernel.org/r/20201127161819.3106432-3-gabriele.paoloni@intel.com
arch/x86/kernel/cpu/mce/core.c