Merge branch 'x86/cleanups' into x86/mm
authorIngo Molnar <mingo@kernel.org>
Fri, 12 Feb 2021 12:39:32 +0000 (13:39 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 12 Feb 2021 12:40:02 +0000 (13:40 +0100)
Merge recent cleanups to the x86 MM code to resolve a conflict.

Conflicts:
arch/x86/mm/fault.c

Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
arch/x86/mm/fault.c

@@@ -1434,39 -1384,10 +1406,37 @@@ good_area
        }
  
        mmap_read_unlock(mm);
 -      if (unlikely(fault & VM_FAULT_ERROR)) {
 -              mm_fault_error(regs, hw_error_code, address, fault);
 +      if (likely(!(fault & VM_FAULT_ERROR)))
 +              return;
 +
 +      if (fatal_signal_pending(current) && !user_mode(regs)) {
 +              kernelmode_fixup_or_oops(regs, error_code, address, 0, 0);
                return;
        }
-       check_v8086_mode(regs, address, tsk);
 +
 +      if (fault & VM_FAULT_OOM) {
 +              /* Kernel mode? Handle exceptions or die: */
 +              if (!user_mode(regs)) {
 +                      kernelmode_fixup_or_oops(regs, error_code, address,
 +                                               SIGSEGV, SEGV_MAPERR);
 +                      return;
 +              }
 +
 +              /*
 +               * We ran out of memory, call the OOM killer, and return the
 +               * userspace (which will retry the fault, or kill us if we got
 +               * oom-killed):
 +               */
 +              pagefault_out_of_memory();
 +      } else {
 +              if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON|
 +                           VM_FAULT_HWPOISON_LARGE))
 +                      do_sigbus(regs, error_code, address, fault);
 +              else if (fault & VM_FAULT_SIGSEGV)
 +                      bad_area_nosemaphore(regs, error_code, address);
 +              else
 +                      BUG();
 +      }
  }
  NOKPROBE_SYMBOL(do_user_addr_fault);