[RFC PATCH] powerpc/Kconfig: Select FUNCTION_ALIGNMENT_4B

Sathvika Vasireddy sv at linux.ibm.com
Mon Mar 6 19:10:42 AEDT 2023


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.

Signed-off-by: Sathvika Vasireddy <sv at linux.ibm.com>

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(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a6c4407d3ec8..ac3f80c0db36 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -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
diff --git a/arch/powerpc/include/asm/linkage.h b/arch/powerpc/include/asm/linkage.h
index b88d1d2cf304..b71b9582e754 100644
--- a/arch/powerpc/include/asm/linkage.h
+++ b/arch/powerpc/include/asm/linkage.h
@@ -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"		\
-- 
2.31.1



More information about the Linuxppc-dev mailing list