Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390: make use of CONFIG_FUNCTION_ALIGNMENT

Make use of CONFIG_FUNCTION_ALIGNMENT which was introduced with commit
d49a0626216b ("arch: Introduce CONFIG_FUNCTION_ALIGNMENT").

Select FUNCTION_ALIGNMENT_8B for gcc in order to reflect gcc's default
function alignment. For all other compilers, which is only clang, select
a function alignment of 16 bytes which reflects the default function
alignment for clang.

Also change the __ALIGN define to follow whatever the value of
CONFIG_FUNCTION_ALIGNMENT is. This makes sure that the alignment of C and
assembler functions is the same.

In result everything still uses the default function alignment for both
compilers. However in addition this is now also true for all assembly
functions, so that all functions have a consistent alignment.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

+3 -1
+2
arch/s390/Kconfig
··· 131 131 select CLONE_BACKWARDS2 132 132 select DMA_OPS if PCI 133 133 select DYNAMIC_FTRACE if FUNCTION_TRACER 134 + select FUNCTION_ALIGNMENT_8B if CC_IS_GCC 135 + select FUNCTION_ALIGNMENT_16B if !CC_IS_GCC 134 136 select GCC12_NO_ARRAY_BOUNDS 135 137 select GENERIC_ALLOCATOR 136 138 select GENERIC_CPU_AUTOPROBE
+1 -1
arch/s390/include/asm/linkage.h
··· 4 4 5 5 #include <linux/stringify.h> 6 6 7 - #define __ALIGN .align 16, 0x07 7 + #define __ALIGN .balign CONFIG_FUNCTION_ALIGNMENT, 0x07 8 8 #define __ALIGN_STR __stringify(__ALIGN) 9 9 10 10 #endif