Ignore:
Timestamp:
Apr 14, 2017, 9:41:36 PM (11 days ago)
Author:
brainslayer
Message:

kernel update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.9/arch/arm64/mm/fault.c

    r31574 r31859  
    4242#include <asm/tlbflush.h>
    4343
    44 static const char *fault_name(unsigned int esr);
     44struct fault_info {
     45        int     (*fn)(unsigned long addr, unsigned int esr,
     46                      struct pt_regs *regs);
     47        int     sig;
     48        int     code;
     49        const char *name;
     50};
     51
     52static const struct fault_info fault_info[];
     53
     54static inline const struct fault_info *esr_to_fault_info(unsigned int esr)
     55{
     56        return fault_info + (esr & 63);
     57}
    4558
    4659#ifdef CONFIG_KPROBES
     
    197210{
    198211        struct siginfo si;
     212        const struct fault_info *inf;
    199213
    200214        if (unhandled_signal(tsk, sig) && show_unhandled_signals_ratelimited()) {
     215                inf = esr_to_fault_info(esr);
    201216                pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n",
    202                         tsk->comm, task_pid_nr(tsk), fault_name(esr), sig,
     217                        tsk->comm, task_pid_nr(tsk), inf->name, sig,
    203218                        addr, esr);
    204219                show_pte(tsk->mm, addr);
     
    219234        struct task_struct *tsk = current;
    220235        struct mm_struct *mm = tsk->active_mm;
     236        const struct fault_info *inf;
    221237
    222238        /*
     
    224240         * handle this fault with.
    225241         */
    226         if (user_mode(regs))
    227                 __do_user_fault(tsk, addr, esr, SIGSEGV, SEGV_MAPERR, regs);
    228         else
     242        if (user_mode(regs)) {
     243                inf = esr_to_fault_info(esr);
     244                __do_user_fault(tsk, addr, esr, inf->sig, inf->code, regs);
     245        } else
    229246                __do_kernel_fault(mm, addr, esr, regs);
    230247}
     
    482499}
    483500
    484 static const struct fault_info {
    485         int     (*fn)(unsigned long addr, unsigned int esr, struct pt_regs *regs);
    486         int     sig;
    487         int     code;
    488         const char *name;
    489 } fault_info[] = {
     501static const struct fault_info fault_info[] = {
    490502        { do_bad,               SIGBUS,  0,             "ttbr address size fault"       },
    491503        { do_bad,               SIGBUS,  0,             "level 1 address size fault"    },
     
    554566};
    555567
    556 static const char *fault_name(unsigned int esr)
    557 {
    558         const struct fault_info *inf = fault_info + (esr & 63);
    559         return inf->name;
    560 }
    561 
    562568/*
    563569 * Dispatch a data abort to the relevant handler.
     
    566572                                         struct pt_regs *regs)
    567573{
    568         const struct fault_info *inf = fault_info + (esr & 63);
     574        const struct fault_info *inf = esr_to_fault_info(esr);
    569575        struct siginfo info;
    570576
Note: See TracChangeset for help on using the changeset viewer.