Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1626091 > unrolled thread

[PATCH v4 1/6] powerpc: ftrace: minor cleanup

Started by"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
First post2017-04-19 15:00 +0200
Last post2017-04-23 14:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v4 1/6] powerpc: ftrace: minor cleanup "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-04-19 15:00 +0200
    Re: [v4,1/6] powerpc: ftrace: minor cleanup Michael Ellerman <patch-notifications@ellerman.id.au> - 2017-04-23 14:00 +0200

#1626091 — [PATCH v4 1/6] powerpc: ftrace: minor cleanup

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2017-04-19 15:00 +0200
Subject[PATCH v4 1/6] powerpc: ftrace: minor cleanup
Message-ID<txXnd-3yQ-61@gated-at.bofh.it>
Move the stack setup and teardown code to the ftrace_graph_caller().
This way, we don't incur the cost of setting it up unless function graph
is enabled for this function.

Also, remove the extraneous LR restore code after the function graph
stub. LR has previously been restored and neither livepatch_handler()
nor ftrace_graph_caller() return back here.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/entry_64.S | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 6432d4bf08c8..8fd8718722a1 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -1313,16 +1313,12 @@ ftrace_call:
 #endif
 
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
-	stdu	r1, -112(r1)
 .globl ftrace_graph_call
 ftrace_graph_call:
 	b	ftrace_graph_stub
 _GLOBAL(ftrace_graph_stub)
-	addi	r1, r1, 112
 #endif
 
-	ld	r0,LRSAVE(r1)	/* restore callee's lr at _mcount site */
-	mtlr	r0
 	bctr			/* jump after _mcount site */
 #endif /* CC_USING_MPROFILE_KERNEL */
 
@@ -1446,6 +1442,7 @@ _GLOBAL(ftrace_stub)
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 #ifndef CC_USING_MPROFILE_KERNEL
 _GLOBAL(ftrace_graph_caller)
+	stdu	r1, -112(r1)
 	/* load r4 with local address */
 	ld	r4, 128(r1)
 	subi	r4, r4, MCOUNT_INSN_SIZE
@@ -1471,6 +1468,7 @@ _GLOBAL(ftrace_graph_caller)
 
 #else /* CC_USING_MPROFILE_KERNEL */
 _GLOBAL(ftrace_graph_caller)
+	stdu	r1, -112(r1)
 	/* with -mprofile-kernel, parameter regs are still alive at _mcount */
 	std	r10, 104(r1)
 	std	r9, 96(r1)
-- 
2.12.1

[toc] | [next] | [standalone]


#1629007 — Re: [v4,1/6] powerpc: ftrace: minor cleanup

FromMichael Ellerman <patch-notifications@ellerman.id.au>
Date2017-04-23 14:00 +0200
SubjectRe: [v4,1/6] powerpc: ftrace: minor cleanup
Message-ID<tzolj-7Zf-3@gated-at.bofh.it>
In reply to#1626091
On Wed, 2017-04-19 at 12:52:23 UTC, "Naveen N. Rao" wrote:
> Move the stack setup and teardown code to the ftrace_graph_caller().
> This way, we don't incur the cost of setting it up unless function graph
> is enabled for this function.
> 
> Also, remove the extraneous LR restore code after the function graph
> stub. LR has previously been restored and neither livepatch_handler()
> nor ftrace_graph_caller() return back here.
> 
> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/700e64377c2c8e2406e9c4c1632e2e

cheers

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web