Skip to contentSkip to conversation

powerpc/Kconfig: Select FUNCTION_ALIGNMENT_4B

RFC PATCH New Sathvika Vasireddy 1 participant 1 message Mar 6, 2023 PowerPC

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 powerpc/Kconfig: Select FUNCTION_ALIGNMENT_4B

Commit d49a0626216b95 ("arch: Introduce CONFIG_FUNCTION_ALIGNMENT") introduced a generic function-alignment infrastructure. Move to using FUNCTION_ALIGNMENT_4B on powerpc, to use the same alignment as that of the existing _GLOBAL macro.

Note:
Given that alignment beyond the minimum requirement may be desirable, should we instead select FUNCTION_ALIGNMENT_16B for ppc64 and select FUNCTION_ALIGNMENT_4B/8B for ppc32?

From vmlinux (pseries_le_defconfig) symbol offsets, it looks like most of the ppc64 symbols are being aligned to a 16B boundary, but there are a few which are not.

Currently, size of vmlinux (built with pseries_le_defconfig) is 47090kB. With FUNCTION_ALIGNMENT_4B selected, size of vmlinux is 47152kB. With FUNCTION_ALIGNMENT_16B selected, size of vmlinux is 47152kB.

Currently, size of vmlinux (built with powernv_defconfig) is 42852kB. With FUNCTION_ALIGNMENT_4B selected, size of vmlinux is 42911kB. With FUNCTION_ALIGNMENT_16B selected, size of vmlinux is 42977kB.

I am wondering if we should use the same alignment as that of _GLOBAL macro or have alignment set to a 8B/16B boundary. Please let me know your thoughts on the same. Thanks!

---
 arch/powerpc/Kconfig               | 1 +
 arch/powerpc/include/asm/linkage.h | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
arch/powerpc/Kconfig +1 -0
index a6c4407d3ec8..ac3f80c0db36 100644
@@ -174,6 +174,7 @@ config PPC
 	select DYNAMIC_FTRACE			if FUNCTION_TRACER
 	select EDAC_ATOMIC_SCRUB
 	select EDAC_SUPPORT
+	select FUNCTION_ALIGNMENT_4B
 	select GENERIC_ATOMIC64			if PPC32
 	select GENERIC_CLOCKEVENTS_BROADCAST	if SMP
 	select GENERIC_CMOS_UPDATE
arch/powerpc/include/asm/linkage.h +0 -3
index b88d1d2cf304..b71b9582e754 100644
@@ -4,9 +4,6 @@
 
 #include <asm/types.h>
 
-#define __ALIGN		.align 2
-#define __ALIGN_STR	".align 2"
-
 #ifdef CONFIG_PPC64_ELF_ABI_V1
 #define cond_syscall(x) \
 	asm ("\t.weak " #x "\n\t.set " #x ", sys_ni_syscall\n"		\
Signature · 1 line
2.31.1