Received: from mailapp01.imgtec.com ([195.59.15.196]:2302 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27008454AbaIHN7LUUp6K (ORCPT ); Mon, 8 Sep 2014 15:59:11 +0200 From: Markos Chandras Subject: [PATCH] MIPS: mcount: Adjust stack pointer for static trace in MIPS32 Date: Mon, 8 Sep 2014 14:58:56 +0100 Message-ID: <1410184736-27208-1-git-send-email-markos.chandras@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-subscribe: List-owner: List-post: List-archive: To: linux-mips@linux-mips.org Cc: Markos Chandras , stable@vger.kernel.org Message-ID: <20140908135856.W1jQLTDw4Lx5GPNAgbULOL8ju0CVBk2tygvac_S7SeU@z> Every mcount() call in the MIPS 32-bit kernel is done as follows: [...] move at, ra jal _mcount addiu sp, sp, -8 [...] but upon returning from the mcount() function, the stack pointer is not adjusted properly. This is explained in details in 58b69401c797 (MIPS: Function tracer: Fix broken function tracing). Commit ad8c396936e3 ("MIPS: Unbreak function tracer for 64-bit kernel.) fixed the stack manipulation for 64-bit but it didn't fix it completely for MIPS32. Cc: Signed-off-by: Markos Chandras --- arch/mips/kernel/mcount.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S index 5d25462de8a6..fbea89ad10ea 100644 --- a/arch/mips/kernel/mcount.S +++ b/arch/mips/kernel/mcount.S @@ -129,7 +129,11 @@ NESTED(_mcount, PT_SIZE, ra) nop #endif b ftrace_stub +#ifdef CONFIG_32BIT + addiu sp,sp,8 +#else nop +#endif static_trace: MCOUNT_SAVE_REGS -- 2.1.0