diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2021-01-30 16:08:23 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-02-08 16:02:09 +0300 |
commit | 4cb8428465148bcca0b6b8593d51f805818a70e0 (patch) | |
tree | 97c0c61126679df49f2095c97ad1ab1093cdd782 /arch/powerpc/mm/fault.c | |
parent | 71f47976fafc4375674bd0714153be10f878040a (diff) | |
download | linux-4cb8428465148bcca0b6b8593d51f805818a70e0.tar.xz |
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: 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
Diffstat (limited to 'arch/powerpc/mm/fault.c')
-rw-r--r-- | arch/powerpc/mm/fault.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index e476d7701413..970ac317e018 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -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); |