From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753629AbdBUQ1Q (ORCPT ); Tue, 21 Feb 2017 11:27:16 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33848 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbdBUQ1J (ORCPT ); Tue, 21 Feb 2017 11:27:09 -0500 From: "Naveen N. Rao" To: Michael Ellerman , Ananth N Mavinakayanahalli , Masami Hiramatsu Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 1/5] powerpc: ftrace: minor cleanup Date: Tue, 21 Feb 2017 21:56:02 +0530 X-Mailer: git-send-email 2.11.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022116-1617-0000-0000-000001AB1296 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022116-1618-0000-0000-000047C6E12F Message-Id: <657c6623953f6cce52f929a93cc250b7ee76d7cc.1487692624.git.naveen.n.rao@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-21_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702210154 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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.11.0