Skip to content

Commit

Permalink
powerpc: rearrange do_page_fault error case to be inside exception_enter
Browse files Browse the repository at this point in the history
This keeps the context tracking over the entire interrupt handler which
helps later with moving context tracking into interrupt wrappers.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210130130852.2952424-14-npiggin@gmail.com
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Feb 8, 2021
1 parent 71f4797 commit 4cb8428
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions arch/powerpc/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,19 +545,24 @@ NOKPROBE_SYMBOL(__do_page_fault);
long do_page_fault(struct pt_regs *regs)
{
const struct exception_table_entry *entry;
enum ctx_state prev_state = exception_enter();
int rc = __do_page_fault(regs, regs->dar, regs->dsisr);
exception_exit(prev_state);
if (likely(!rc))
return 0;
enum ctx_state prev_state;
long err;

prev_state = exception_enter();
err = __do_page_fault(regs, regs->dar, regs->dsisr);
if (likely(!err))
goto out;

entry = search_exception_tables(regs->nip);
if (unlikely(!entry))
return rc;
if (likely(entry)) {
instruction_pointer_set(regs, extable_fixup(entry));
err = 0;
}

instruction_pointer_set(regs, extable_fixup(entry));
out:
exception_exit(prev_state);

return 0;
return err;
}
NOKPROBE_SYMBOL(do_page_fault);

Expand Down

0 comments on commit 4cb8428

Please sign in to comment.