s390: make use of CONFIG_FUNCTION_ALIGNMENT
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 13 Mar 2023 12:50:35 +0000 (13:50 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 20 Mar 2023 10:12:46 +0000 (11:12 +0100)
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>
arch/s390/Kconfig
arch/s390/include/asm/linkage.h

index 9809c74e1240600de4ce0465c1f70e5666029746..8f1c6da2ae4d459979281474852a74c0bcbb41ae 100644 (file)
@@ -131,6 +131,8 @@ config S390
        select CLONE_BACKWARDS2
        select DMA_OPS if PCI
        select DYNAMIC_FTRACE if FUNCTION_TRACER
+       select FUNCTION_ALIGNMENT_8B if CC_IS_GCC
+       select FUNCTION_ALIGNMENT_16B if !CC_IS_GCC
        select GCC12_NO_ARRAY_BOUNDS
        select GENERIC_ALLOCATOR
        select GENERIC_CPU_AUTOPROBE
index c76777b15fecb3fd7b6b748b5d2eaf391eda1c78..df3fb7d8227b2590d17c9ce01a8289b60a260297 100644 (file)
@@ -4,7 +4,7 @@
 
 #include <linux/stringify.h>
 
-#define __ALIGN .align 16, 0x07
+#define __ALIGN .balign CONFIG_FUNCTION_ALIGNMENT, 0x07
 #define __ALIGN_STR __stringify(__ALIGN)
 
 #endif