Skip to content

Commit

Permalink
powerpc/mm: Move exception_enter/exit to a do_page_fault wrapper
Browse files Browse the repository at this point in the history
This will allow simplifying the returns from do_page_fault

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Benjamin Herrenschmidt authored and Michael Ellerman committed Aug 2, 2017
1 parent 424de9c commit 7afad42
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions arch/powerpc/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,9 @@ static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)
* The return value is 0 if the fault was handled, or the signal
* number if this is a kernel fault that can't be handled here.
*/
int do_page_fault(struct pt_regs *regs, unsigned long address,
unsigned long error_code)
static int __do_page_fault(struct pt_regs *regs, unsigned long address,
unsigned long error_code)
{
enum ctx_state prev_state = exception_enter();
struct vm_area_struct * vma;
struct mm_struct *mm = current->mm;
unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
Expand Down Expand Up @@ -523,6 +522,15 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
rc = SIGSEGV;

bail:
return rc;
}
NOKPROBE_SYMBOL(__do_page_fault);

int do_page_fault(struct pt_regs *regs, unsigned long address,
unsigned long error_code)
{
enum ctx_state prev_state = exception_enter();
int rc = __do_page_fault(regs, address, error_code);
exception_exit(prev_state);
return rc;
}
Expand Down

0 comments on commit 7afad42

Please sign in to comment.