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

s390: Provide MARCH_HAS_*_FEATURES defines

Provide MARCH_HAS_*_FEATURES defines which are supposed to be used
everywhere instead of the CONFIG_HAVE_MARCH_*_FEATURES defines.

Various header files contain code which depend on the
CONFIG_HAVE_MARCH_*_FEATURES defines, allowing for compile time
optimizations. If such code is used within the decompressor wrong code may
be generated (the compiler may generate instructions which are not
available for the minimum architecture level of the decompressor).

Therefore provide a new header file with MARCH_HAS_*_FEATURES defines,
which are only available if __DECOMPRESSOR is not defined. This way code
generation for the kernel image is still optimized depending on
CONFIG_HAVE_MARCH_*_FEATURES, while code generated for the decompressor is
compiled for the minimum architecture level.

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

+38
+38
arch/s390/include/asm/march.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + 3 + #ifndef __ASM_S390_MARCH_H 4 + #define __ASM_S390_MARCH_H 5 + 6 + #include <linux/kconfig.h> 7 + 8 + #define MARCH_HAS_Z10_FEATURES 1 9 + 10 + #ifndef __DECOMPRESSOR 11 + 12 + #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES 13 + #define MARCH_HAS_Z196_FEATURES 1 14 + #endif 15 + 16 + #ifdef CONFIG_HAVE_MARCH_ZEC12_FEATURES 17 + #define MARCH_HAS_ZEC12_FEATURES 1 18 + #endif 19 + 20 + #ifdef CONFIG_HAVE_MARCH_Z13_FEATURES 21 + #define MARCH_HAS_Z13_FEATURES 1 22 + #endif 23 + 24 + #ifdef CONFIG_HAVE_MARCH_Z14_FEATURES 25 + #define MARCH_HAS_Z14_FEATURES 1 26 + #endif 27 + 28 + #ifdef CONFIG_HAVE_MARCH_Z15_FEATURES 29 + #define MARCH_HAS_Z15_FEATURES 1 30 + #endif 31 + 32 + #ifdef CONFIG_HAVE_MARCH_Z16_FEATURES 33 + #define MARCH_HAS_Z16_FEATURES 1 34 + #endif 35 + 36 + #endif /* __DECOMPRESSOR */ 37 + 38 + #endif /* __ASM_S390_MARCH_H */