]> git.baikalelectronics.ru Git - kernel.git/commit
x86/mce: Delay clearing IA32_MCG_STATUS to the end of do_machine_check()
authorTony Luck <tony.luck@intel.com>
Mon, 24 Aug 2020 22:12:37 +0000 (15:12 -0700)
committerBorislav Petkov <bp@suse.de>
Wed, 26 Aug 2020 16:40:18 +0000 (18:40 +0200)
commit72a946df6c78fb344cf9f7ae85257efbd7a51911
treec7b0f93c2091c7b1edc6b8419f16321dfd9c4431
parentf07701ef071dbff4ff0f1b8f8e86df55aeaeeb8a
x86/mce: Delay clearing IA32_MCG_STATUS to the end of do_machine_check()

A long time ago, Linux cleared IA32_MCG_STATUS at the very end of machine
check processing.

Then, some fancy recovery and IST manipulation was added in:

  2a4c15668f4a ("x86, mce: Get rid of TIF_MCE_NOTIFY and associated mce tricks")

and clearing IA32_MCG_STATUS was pulled earlier in the function.

Next change moved the actual recovery out of do_machine_check() and
just used task_work_add() to schedule it later (before returning to the
user):

  72956f2779f8 ("x86/mce: Send #MC singal from task work")

Most recently the fancy IST footwork was removed as no longer needed:

  0d659dacf58b ("x86/entry: Get rid of ist_begin/end_non_atomic()")

At this point there is no reason remaining to clear IA32_MCG_STATUS early.
It can move back to the very end of the function.

Also move sync_core(). The comments for this function say that it should
only be called when instructions have been changed/re-mapped. Recovery
for an instruction fetch may change the physical address. But that
doesn't happen until the scheduled work runs (which could be on another
CPU).

 [ bp: Massage commit message. ]

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