diff mbox series

[RFC] powerpc/Kconfig: Select FUNCTION_ALIGNMENT_4B

Message ID 20230306081042.299871-1-sv@linux.ibm.com (mailing list archive)
State RFC
Headers show
Series [RFC] powerpc/Kconfig: Select FUNCTION_ALIGNMENT_4B | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 24 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 6 jobs.

Commit Message

Sathvika Vasireddy March 6, 2023, 8:10 a.m. UTC
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@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 mbox series

Patch

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"		\