[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190822201620.z7eto2cfjo4uaozb@treble>
Date: Thu, 22 Aug 2019 15:16:20 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Raphael Gault <raphael.gault@....com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
peterz@...radead.org, catalin.marinas@....com, will.deacon@....com,
julien.thierry.kdev@...il.com, raph.gault+kdev@...il.com
Subject: Re: [RFC v4 13/18] arm64: sleep: Prevent stack frame warnings from
objtool
On Fri, Aug 16, 2019 at 01:23:58PM +0100, Raphael Gault wrote:
> This code doesn't respect the Arm PCS but it is intended this
> way. Adapting it to respect the PCS would result in altering the
> behaviour.
>
> In order to suppress objtool's warnings, we setup a stack frame
> for __cpu_suspend_enter and annotate cpu_resume and _cpu_resume
> as having non-standard stack frames.
>
> Signed-off-by: Raphael Gault <raphael.gault@....com>
> ---
> arch/arm64/kernel/sleep.S | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S
> index f5b04dd8a710..55c7c099d32c 100644
> --- a/arch/arm64/kernel/sleep.S
> +++ b/arch/arm64/kernel/sleep.S
> @@ -1,5 +1,6 @@
> /* SPDX-License-Identifier: GPL-2.0 */
> #include <linux/errno.h>
> +#include <linux/frame.h>
> #include <linux/linkage.h>
> #include <asm/asm-offsets.h>
> #include <asm/assembler.h>
> @@ -90,6 +91,7 @@ ENTRY(__cpu_suspend_enter)
> str x0, [x1]
> add x0, x0, #SLEEP_STACK_DATA_SYSTEM_REGS
> stp x29, lr, [sp, #-16]!
> + mov x29, sp
> bl cpu_do_suspend
> ldp x29, lr, [sp], #16
> mov x0, #1
> @@ -146,3 +148,6 @@ ENTRY(_cpu_resume)
> mov x0, #0
> ret
> ENDPROC(_cpu_resume)
> +
> + asm_stack_frame_non_standard cpu_resume
> + asm_stack_frame_non_standard _cpu_resume
We usually put these annotations immediately after the functions they're
annotating. And they should resemble the C macros like
STACK_FRAME_NON_STANDARD(cpu_resume)
--
Josh
Powered by blists - more mailing lists