Skip to content

Commit

Permalink
signal/arm64: Only call set_thread_esr once in do_page_fault
Browse files Browse the repository at this point in the history
This code is truly common between the signal sending cases so share it.

Reviewed-by: Catalin Marinas <[email protected]>
Tested-by: Catalin Marinas <[email protected]>
Signed-off-by: Eric W. Biederman <[email protected]>
  • Loading branch information
ebiederm committed Sep 27, 2018
1 parent 2d2837f commit 559d8d9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions arch/arm64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
}

inf = esr_to_fault_info(esr);
set_thread_esr(addr, esr);
if (fault & VM_FAULT_SIGBUS) {
/*
* We had some memory, but were unable to successfully fix up
Expand All @@ -573,7 +574,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
si.si_signo = SIGBUS;
si.si_code = BUS_ADRERR;
si.si_addr = (void __user *)addr;
set_thread_esr(addr, esr);
arm64_force_sig_info(&si, inf->name);
} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
unsigned int lsb;
Expand All @@ -587,7 +587,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
si.si_code = BUS_MCEERR_AR;
si.si_addr = (void __user *)addr;
si.si_addr_lsb = lsb;
set_thread_esr(addr, esr);
arm64_force_sig_info(&si, inf->name);
} else {
/*
Expand All @@ -599,7 +598,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
si.si_code = fault == VM_FAULT_BADACCESS ?
SEGV_ACCERR : SEGV_MAPERR;
si.si_addr = (void __user *)addr;
set_thread_esr(addr, esr);
arm64_force_sig_info(&si, inf->name);
}

Expand Down

0 comments on commit 559d8d9

Please sign in to comment.