Commit 4cb84284 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

powerpc: rearrange do_page_fault error case to be inside exception_enter

This keeps the context tracking over the entire interrupt handler which
helps later with moving context tracking into interrupt wrappers.
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210130130852.2952424-14-npiggin@gmail.com
parent 71f47976
...@@ -545,19 +545,24 @@ NOKPROBE_SYMBOL(__do_page_fault); ...@@ -545,19 +545,24 @@ NOKPROBE_SYMBOL(__do_page_fault);
long do_page_fault(struct pt_regs *regs) long do_page_fault(struct pt_regs *regs)
{ {
const struct exception_table_entry *entry; const struct exception_table_entry *entry;
enum ctx_state prev_state = exception_enter(); enum ctx_state prev_state;
int rc = __do_page_fault(regs, regs->dar, regs->dsisr); long err;
exception_exit(prev_state);
if (likely(!rc))
return 0;
entry = search_exception_tables(regs->nip); prev_state = exception_enter();
if (unlikely(!entry)) err = __do_page_fault(regs, regs->dar, regs->dsisr);
return rc; if (likely(!err))
goto out;
entry = search_exception_tables(regs->nip);
if (likely(entry)) {
instruction_pointer_set(regs, extable_fixup(entry)); instruction_pointer_set(regs, extable_fixup(entry));
err = 0;
}
return 0; out:
exception_exit(prev_state);
return err;
} }
NOKPROBE_SYMBOL(do_page_fault); NOKPROBE_SYMBOL(do_page_fault);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment