Merge branch 'x86/entry' into ras/core
authorThomas Gleixner <tglx@linutronix.de>
Thu, 11 Jun 2020 13:17:57 +0000 (15:17 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 11 Jun 2020 13:17:57 +0000 (15:17 +0200)
to fixup conflicts in arch/x86/kernel/cpu/mce/core.c so MCE specific follow
up patches can be applied without creating a horrible merge conflict
afterwards.

1  2 
arch/x86/include/asm/mce.h
arch/x86/kernel/cpu/mce/amd.c
arch/x86/kernel/cpu/mce/core.c
arch/x86/kernel/cpu/mce/internal.h
drivers/edac/amd64_edac.c
drivers/edac/skx_common.c
drivers/hwmon/k10temp.c
include/linux/pci_ids.h

Simple merge
Simple merge
@@@ -1323,34 -1356,21 +1327,32 @@@ void noinstr do_machine_check(struct pt
  
        /* Fault was in user mode and we need to take some action */
        if ((m.cs & 3) == 3) {
-               ist_begin_non_atomic(regs);
-               local_irq_enable();
-               if (kill_it || do_memory_failure(&m))
-                       force_sig(SIGBUS);
-               local_irq_disable();
-               ist_end_non_atomic();
+               /* If this triggers there is no way to recover. Die hard. */
+               BUG_ON(!on_thread_stack() || !user_mode(regs));
+               current->mce_addr = m.addr;
+               current->mce_status = m.mcgstatus;
+               current->mce_kill_me.func = kill_me_maybe;
+               if (kill_it)
+                       current->mce_kill_me.func = kill_me_now;
+               task_work_add(current, &current->mce_kill_me, true);
        } else {
 -              if (!fixup_exception(regs, X86_TRAP_MC, 0, 0))
 -                      mce_panic("Failed kernel mode recovery", &m, msg);
 +              /*
 +               * Handle an MCE which has happened in kernel space but from
 +               * which the kernel can recover: ex_has_fault_handler() has
 +               * already verified that the rIP at which the error happened is
 +               * a rIP from which the kernel can recover (by jumping to
 +               * recovery code specified in _ASM_EXTABLE_FAULT()) and the
 +               * corresponding exception handler which would do that is the
 +               * proper one.
 +               */
 +              if (m.kflags & MCE_IN_KERNEL_RECOV) {
-                       if (!fixup_exception(regs, X86_TRAP_MC, error_code, 0))
++                      if (!fixup_exception(regs, X86_TRAP_MC, 0, 0))
 +                              mce_panic("Failed kernel mode recovery", &m, msg);
 +              }
        }
- out_ist:
-       ist_exit(regs);
  }
  EXPORT_SYMBOL_GPL(do_machine_check);
- NOKPROBE_SYMBOL(do_machine_check);
  
  #ifndef CONFIG_MEMORY_FAILURE
  int memory_failure(unsigned long pfn, int flags)
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge