]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/arm64/kernel/armv8_deprecated.c
arm64: consolidate signal injection on emulation errors
[karo-tx-linux.git] / arch / arm64 / kernel / armv8_deprecated.c
index c37202c0c838d01a71d56b05d114cd0b419ff480..fab5603f57ea845bde619879cb132b16d9057a57 100644 (file)
@@ -316,28 +316,6 @@ static void __init register_insn_emulation_sysctl(struct ctl_table *table)
  */
 #define TYPE_SWPB (1 << 22)
 
-/*
- * Set up process info to signal segmentation fault - called on access error.
- */
-static void set_segfault(struct pt_regs *regs, unsigned long addr)
-{
-       siginfo_t info;
-
-       down_read(&current->mm->mmap_sem);
-       if (find_vma(current->mm, addr) == NULL)
-               info.si_code = SEGV_MAPERR;
-       else
-               info.si_code = SEGV_ACCERR;
-       up_read(&current->mm->mmap_sem);
-
-       info.si_signo = SIGSEGV;
-       info.si_errno = 0;
-       info.si_addr  = (void *) instruction_pointer(regs);
-
-       pr_debug("SWP{B} emulation: access caused memory abort!\n");
-       arm64_notify_die("Illegal memory access", regs, &info, 0);
-}
-
 static int emulate_swpX(unsigned int address, unsigned int *data,
                        unsigned int type)
 {
@@ -430,7 +408,8 @@ ret:
        return 0;
 
 fault:
-       set_segfault(regs, address);
+       pr_debug("SWP{B} emulation: access caused memory abort!\n");
+       arm64_notify_segfault(regs, address);
 
        return 0;
 }