forked from Minki/linux
signal/arm64: Expand __do_user_fault and remove it
Not all of the signals passed to __do_user_fault can be handled the same way so expand the now tiny __do_user_fault in it's callers and remove it. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Tested-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
parent
aefab2b4c0
commit
effb093ad2
@ -354,12 +354,6 @@ static void set_thread_esr(unsigned long address, unsigned int esr)
|
||||
current->thread.fault_code = esr;
|
||||
}
|
||||
|
||||
static void __do_user_fault(struct siginfo *info, unsigned int esr)
|
||||
{
|
||||
set_thread_esr((unsigned long)info->si_addr, esr);
|
||||
arm64_force_sig_info(info, esr_to_fault_info(esr)->name);
|
||||
}
|
||||
|
||||
static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)
|
||||
{
|
||||
/*
|
||||
@ -375,7 +369,8 @@ static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *re
|
||||
si.si_code = inf->code;
|
||||
si.si_addr = (void __user *)addr;
|
||||
|
||||
__do_user_fault(&si, esr);
|
||||
set_thread_esr(addr, esr);
|
||||
arm64_force_sig_info(&si, inf->name);
|
||||
} else {
|
||||
__do_kernel_fault(addr, esr, regs);
|
||||
}
|
||||
@ -576,7 +571,8 @@ retry:
|
||||
si.si_signo = SIGBUS;
|
||||
si.si_code = BUS_ADRERR;
|
||||
si.si_addr = (void __user *)addr;
|
||||
__do_user_fault(&si, esr);
|
||||
set_thread_esr(addr, esr);
|
||||
arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
|
||||
} else if (fault & (VM_FAULT_HWPOISON_LARGE | VM_FAULT_HWPOISON)) {
|
||||
unsigned int lsb;
|
||||
|
||||
@ -589,7 +585,8 @@ retry:
|
||||
si.si_code = BUS_MCEERR_AR;
|
||||
si.si_addr = (void __user *)addr;
|
||||
si.si_addr_lsb = lsb;
|
||||
__do_user_fault(&si, esr);
|
||||
set_thread_esr(addr, esr);
|
||||
arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
|
||||
} else {
|
||||
/*
|
||||
* Something tried to access memory that isn't in our memory
|
||||
@ -600,7 +597,8 @@ retry:
|
||||
si.si_code = fault == VM_FAULT_BADACCESS ?
|
||||
SEGV_ACCERR : SEGV_MAPERR;
|
||||
si.si_addr = (void __user *)addr;
|
||||
__do_user_fault(&si, esr);
|
||||
set_thread_esr(addr, esr);
|
||||
arm64_force_sig_info(&si, esr_to_fault_info(esr)->name);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user