diff mbox series

[RFC,V3,12/18] arm64: assembler: Add macro to annotate asm function having non standard stack-frame.

Message ID 20190624095548.8578-13-raphael.gault@arm.com (mailing list archive)
State RFC
Headers show
Series objtool: Add support for arm64 | expand

Commit Message

Raphael Gault June 24, 2019, 9:55 a.m. UTC
Some functions don't have standard stack-frames but are intended
this way. In order for objtool to ignore those particular cases
we add a macro that enables us to annotate the cases we chose
to mark as particular.

Signed-off-by: Raphael Gault <raphael.gault@arm.com>
---
 arch/arm64/include/asm/assembler.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Catalin Marinas July 1, 2019, 2:40 p.m. UTC | #1
On Mon, Jun 24, 2019 at 10:55:42AM +0100, Raphael Gault wrote:
> --- a/arch/arm64/include/asm/assembler.h
> +++ b/arch/arm64/include/asm/assembler.h
> @@ -752,4 +752,17 @@ USER(\label, ic	ivau, \tmp2)			// invalidate I line PoU
>  .Lyield_out_\@ :
>  	.endm
>  
> +	/*
> +	 * This macro is the arm64 assembler equivalent of the
> +	 * macro STACK_FRAME_NON_STANDARD define at
> +	 * ~/include/linux/frame.h
> +	 */
> +	.macro	asm_stack_frame_non_standard	func
> +#ifdef	CONFIG_STACK_VALIDATION
> +	.pushsection ".discard.func_stack_frame_non_standard"
> +	.8byte	\func

Nitpicks:

Does .quad vs .8byte make any difference?

Could we place this in include/linux/frame.h directly with a generic
name (and some __ASSEMBLY__ guards)? It doesn't look to be arm specific.
Raphael Gault July 2, 2019, 9:49 a.m. UTC | #2
Hi,

On 7/1/19 3:40 PM, Catalin Marinas wrote:
> On Mon, Jun 24, 2019 at 10:55:42AM +0100, Raphael Gault wrote:
>> --- a/arch/arm64/include/asm/assembler.h
>> +++ b/arch/arm64/include/asm/assembler.h
>> @@ -752,4 +752,17 @@ USER(\label, ic	ivau, \tmp2)			// invalidate I line PoU
>>   .Lyield_out_\@ :
>>   	.endm
>>   
>> +	/*
>> +	 * This macro is the arm64 assembler equivalent of the
>> +	 * macro STACK_FRAME_NON_STANDARD define at
>> +	 * ~/include/linux/frame.h
>> +	 */
>> +	.macro	asm_stack_frame_non_standard	func
>> +#ifdef	CONFIG_STACK_VALIDATION
>> +	.pushsection ".discard.func_stack_frame_non_standard"
>> +	.8byte	\func
> 
> Nitpicks:
> 
> Does .quad vs .8byte make any difference?
> 

No it doesn't, I'll use .quad then.

> Could we place this in include/linux/frame.h directly with a generic
> name (and some __ASSEMBLY__ guards)? It doesn't look to be arm specific.
> 

It might be more consistent indeed, I'll do that.

Thanks,
diff mbox series

Patch

diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index 570d195a184d..969a59c5c276 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -752,4 +752,17 @@  USER(\label, ic	ivau, \tmp2)			// invalidate I line PoU
 .Lyield_out_\@ :
 	.endm
 
+	/*
+	 * This macro is the arm64 assembler equivalent of the
+	 * macro STACK_FRAME_NON_STANDARD define at
+	 * ~/include/linux/frame.h
+	 */
+	.macro	asm_stack_frame_non_standard	func
+#ifdef	CONFIG_STACK_VALIDATION
+	.pushsection ".discard.func_stack_frame_non_standard"
+	.8byte	\func
+	.popsection
+#endif
+	.endm
+
 #endif	/* __ASM_ASSEMBLER_H */