]> Git Repo - linux.git/blobdiff - arch/powerpc/mm/fault.c
doc:process: add links where missing
[linux.git] / arch / powerpc / mm / fault.c
index e5725fa96a4811f337f13b84414fbbbbd15ca11b..1697e903bbf28b944d3f6538875230825ab262df 100644 (file)
@@ -103,8 +103,7 @@ static bool store_updates_sp(unsigned int inst)
  */
 
 static int
-__bad_area_nosemaphore(struct pt_regs *regs, unsigned long address, int si_code,
-               int pkey)
+__bad_area_nosemaphore(struct pt_regs *regs, unsigned long address, int si_code)
 {
        /*
         * If we are in kernel mode, bail out with a SEGV, this will
@@ -114,14 +113,14 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long address, int si_code,
        if (!user_mode(regs))
                return SIGSEGV;
 
-       _exception_pkey(SIGSEGV, regs, si_code, address, pkey);
+       _exception(SIGSEGV, regs, si_code, address);
 
        return 0;
 }
 
 static noinline int bad_area_nosemaphore(struct pt_regs *regs, unsigned long address)
 {
-       return __bad_area_nosemaphore(regs, address, SEGV_MAPERR, 0);
+       return __bad_area_nosemaphore(regs, address, SEGV_MAPERR);
 }
 
 static int __bad_area(struct pt_regs *regs, unsigned long address, int si_code)
@@ -134,7 +133,7 @@ static int __bad_area(struct pt_regs *regs, unsigned long address, int si_code)
         */
        up_read(&mm->mmap_sem);
 
-       return __bad_area_nosemaphore(regs, address, si_code, 0);
+       return __bad_area_nosemaphore(regs, address, si_code);
 }
 
 static noinline int bad_area(struct pt_regs *regs, unsigned long address)
@@ -145,7 +144,17 @@ static noinline int bad_area(struct pt_regs *regs, unsigned long address)
 static int bad_key_fault_exception(struct pt_regs *regs, unsigned long address,
                                    int pkey)
 {
-       return __bad_area_nosemaphore(regs, address, SEGV_PKUERR, pkey);
+       /*
+        * If we are in kernel mode, bail out with a SEGV, this will
+        * be caught by the assembly which will restore the non-volatile
+        * registers before calling bad_page_fault()
+        */
+       if (!user_mode(regs))
+               return SIGSEGV;
+
+       _exception_pkey(regs, address, pkey);
+
+       return 0;
 }
 
 static noinline int bad_access(struct pt_regs *regs, unsigned long address)
@@ -156,17 +165,10 @@ static noinline int bad_access(struct pt_regs *regs, unsigned long address)
 static int do_sigbus(struct pt_regs *regs, unsigned long address,
                     vm_fault_t fault)
 {
-       siginfo_t info;
-
        if (!user_mode(regs))
                return SIGBUS;
 
        current->thread.trap_nr = BUS_ADRERR;
-       clear_siginfo(&info);
-       info.si_signo = SIGBUS;
-       info.si_errno = 0;
-       info.si_code = BUS_ADRERR;
-       info.si_addr = (void __user *)address;
 #ifdef CONFIG_MEMORY_FAILURE
        if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
                unsigned int lsb = 0; /* shutup gcc */
@@ -185,7 +187,7 @@ static int do_sigbus(struct pt_regs *regs, unsigned long address,
        }
 
 #endif
-       force_sig_info(SIGBUS, &info, current);
+       force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current);
        return 0;
 }
 
This page took 0.032673 seconds and 4 git commands to generate.