Thread (64 messages) 64 messages, 10 authors, 2023-02-04

Re: [PATCH v2 02/16] powerpc: override __ALIGN() and __ALIGN_STR() macros

From: Christophe Leroy <hidden>
Date: 2022-08-29 13:28:25
Also in: lkml


Le 29/08/2022 à 07:52, Sathvika Vasireddy a écrit :
quoted hunk ↗ jump to hunk
Powerpc instructions must be word-aligned. Currently,
there is an alignment of 16 bytes (by default), and it is
much more than what is required for powerpc (4 bytes).

The default expansion of __ALIGN() macro is:
#define __ALIGN       .align 4,0x90

Since Powerpc Linux does not require a 16 byte alignment,
override __ALIGN() and __ALIGN_STR() macros to use required
4 byte alignment.

Signed-off-by: Sathvika Vasireddy <redacted>
---
  arch/powerpc/include/asm/linkage.h | 4 ++++
  1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/include/asm/linkage.h b/arch/powerpc/include/asm/linkage.h
index b71b9582e754..8df88fe61438 100644
--- a/arch/powerpc/include/asm/linkage.h
+++ b/arch/powerpc/include/asm/linkage.h
@@ -2,8 +2,12 @@
  #ifndef _ASM_POWERPC_LINKAGE_H
  #define _ASM_POWERPC_LINKAGE_H
  
+#include <linux/stringify.h>
  #include <asm/types.h>
  
+#define __ALIGN			.align 2
+#define __ALIGN_STR		__stringify(__ALIGN)
+
I still can't see the added value of using __stringify() macro here. In 
order to use that macro you have to include linux/stringify.h . Usually 
we try to minimise the amount of headers required by other headers.
  #ifdef CONFIG_PPC64_ELF_ABI_V1
  #define cond_syscall(x) \
  	asm ("\t.weak " #x "\n\t.set " #x ", sys_ni_syscall\n"		\
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help