Re: [PATCH v1 06/15] powerpc: Remove address and errorcode arguments from do_break()

From: Nicholas Piggin
Date: Sat Dec 26 2020 - 22:27:48 EST


Excerpts from Christophe Leroy's message of December 22, 2020 11:28 pm:
> Let do_break() retrieve address and errorcode from regs.
>
> This simplifies the code and shouldn't impeed performance as
> address and errorcode are likely still hot in the cache.
>
> Suggested-by: Nicholas Piggin <npiggin@xxxxxxxxx>
> Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxxxxxx>
> ---
> arch/powerpc/include/asm/debug.h | 3 +--
> arch/powerpc/kernel/exceptions-64s.S | 2 --
> arch/powerpc/kernel/head_8xx.S | 5 -----
> arch/powerpc/kernel/process.c | 8 +++-----
> 4 files changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/debug.h b/arch/powerpc/include/asm/debug.h
> index ec57daf87f40..0550eceab3ca 100644
> --- a/arch/powerpc/include/asm/debug.h
> +++ b/arch/powerpc/include/asm/debug.h
> @@ -52,8 +52,7 @@ extern void do_send_trap(struct pt_regs *regs, unsigned long address,
> unsigned long error_code, int brkpt);
> #else
>
> -extern void do_break(struct pt_regs *regs, unsigned long address,
> - unsigned long error_code);
> +void do_break(struct pt_regs *regs);
> #endif
>
> #endif /* _ASM_POWERPC_DEBUG_H */
> diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
> index cfbd1d690033..3ea067bcbb95 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -3262,8 +3262,6 @@ handle_page_fault:
>
> /* We have a data breakpoint exception - handle it */
> handle_dabr_fault:
> - ld r4,_DAR(r1)
> - ld r5,_DSISR(r1)
> addi r3,r1,STACK_FRAME_OVERHEAD
> bl do_break
> /*
> diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
> index 52702f3db6df..81f3c984f50c 100644
> --- a/arch/powerpc/kernel/head_8xx.S
> +++ b/arch/powerpc/kernel/head_8xx.S
> @@ -364,11 +364,6 @@ do_databreakpoint:
> addi r3,r1,STACK_FRAME_OVERHEAD
> mfspr r4,SPRN_BAR
> stw r4,_DAR(r11)
> -#ifdef CONFIG_VMAP_STACK
> - lwz r5,_DSISR(r11)
> -#else
> - mfspr r5,SPRN_DSISR
> -#endif

I didn't think you can do this (at leastuntil after your patch 10). I have my
!VMAP path doing mfspr r5,DSISR ; stw r3,_DSISR(r11);

Thanks,
Nick