Thread (20 messages) flat view 20 messages, 3 authors, 2015-07-17

Re: [RFC PATCH 01/12] powerpc/kernel: Get pt_regs from r9 before calling do_syscall_trace_enter()

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2015-07-17 04:41:09
Also in: lkml

On Fri, 2015-07-17 at 08:40 +1000, Benjamin Herrenschmidt wrote:
On Wed, 2015-07-15 at 17:37 +1000, Michael Ellerman wrote:
quoted
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 ?
No.

I'm not going to bother measuring it :)
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 ...
Yeah true.

There is an "invariant" in that entry code that r9 contains pt_regs, you can
see for example the DTL code goes to pains to ensure it puts pt_regs back in r9
after it clobbers it. As does the current syscall_dotrace.

But looking closer I don't see where we actually use that (prior to this
patch).

So yeah I'll drop this and send a clean up to just get rid of all the r9
reloading.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help