lkml.org 
[lkml]   [2015]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 01/12] powerpc/kernel: Get pt_regs from r9 before calling do_syscall_trace_enter()
From
Date
On Wed, 2015-07-15 at 17:37 +1000, Michael Ellerman wrote:
> To call do_syscall_trace_enter() we need pt_regs in r3, but we don't need
> to recalculate it based on r1, it's already in r9.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Is there any performance difference ?

I find the addi a bit more robust in case the code gets moved around or
the "previous" code gets changed to either not use r9 or clobber it,
which would have the potential to
introduce a subtle bug ...

Ben.

> ---
> arch/powerpc/kernel/entry_64.S | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
> index 579e0f9a2d57..0796c487d3db 100644
> --- a/arch/powerpc/kernel/entry_64.S
> +++ b/arch/powerpc/kernel/entry_64.S
> @@ -243,7 +243,9 @@ syscall_error:
> /* Traced system call support */
> syscall_dotrace:
> bl save_nvgprs
> - addi r3,r1,STACK_FRAME_OVERHEAD
> +
> + /* Get pt_regs into r3 */
> + mr r3, r9
> bl do_syscall_trace_enter
> /*
> * Restore argument registers possibly just changed.




\
 
 \ /
  Last update: 2015-07-17 01:01    [W:0.094 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site