From: Heiko Carstens Date: Fri, 7 Feb 2025 14:49:08 +0000 (+0100) Subject: s390/vx: Convert cpu_has_vx() to cpu feature function X-Git-Tag: v6.15-rc1~113^2~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db14f78ecb02292e5013d7f46cf01be4d006262d;p=thirdparty%2Flinux.git s390/vx: Convert cpu_has_vx() to cpu feature function Instead of having a private cpu_has_vx() implementation use the new common cpu feature method. Move the facility detection to the decompressor so it matches all other cpu features. Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik --- diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index 9c4b2b317af26..98649e5049895 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -141,6 +141,8 @@ static void detect_facilities(void) set_machine_feature(MFEATURE_TX); local_ctl_set_bit(0, CR0_TRANSACTIONAL_EXECUTION_BIT); } + if (cpu_has_vx()) + local_ctl_set_bit(0, CR0_VECTOR_BIT); } static int cmma_test_essa(void) diff --git a/arch/s390/include/asm/cpufeature.h b/arch/s390/include/asm/cpufeature.h index 026a43b86fd72..781f45e88821c 100644 --- a/arch/s390/include/asm/cpufeature.h +++ b/arch/s390/include/asm/cpufeature.h @@ -31,5 +31,6 @@ int cpu_have_feature(unsigned int nr); #define cpu_has_seq_insn() test_facility(85) #define cpu_has_tlb_lc() test_facility(51) #define cpu_has_topology() test_facility(11) +#define cpu_has_vx() test_facility(129) #endif /* __ASM_S390_CPUFEATURE_H */ diff --git a/arch/s390/include/asm/fpu.h b/arch/s390/include/asm/fpu.h index c84cb33913e29..960c6c67ad6cf 100644 --- a/arch/s390/include/asm/fpu.h +++ b/arch/s390/include/asm/fpu.h @@ -44,6 +44,7 @@ #ifndef _ASM_S390_FPU_H #define _ASM_S390_FPU_H +#include #include #include #include @@ -51,12 +52,6 @@ #include #include #include -#include - -static inline bool cpu_has_vx(void) -{ - return likely(test_facility(129)); -} enum { KERNEL_FPC_BIT = 0, diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index fc30eb222ee9f..081f67abe05ea 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c @@ -184,16 +184,10 @@ static noinline __init void setup_lowcore_early(void) lc->return_mcck_lpswe = gen_lpswe(__LC_RETURN_MCCK_PSW); } -static __init void detect_machine_facilities(void) -{ - if (test_facility(129)) - system_ctl_set_bit(0, CR0_VECTOR_BIT); -} - static inline void save_vector_registers(void) { #ifdef CONFIG_CRASH_DUMP - if (test_facility(129)) + if (cpu_has_vx()) save_vx_regs(boot_cpu_vector_save_area); #endif } @@ -232,7 +226,6 @@ void __init startup_init(void) setup_lowcore_early(); setup_arch_string(); setup_boot_command_line(); - detect_machine_facilities(); save_vector_registers(); setup_topology(); sclp_early_detect(); diff --git a/lib/raid6/s390vx.uc b/lib/raid6/s390vx.uc index 863e2d3209389..8aa53eb2f3958 100644 --- a/lib/raid6/s390vx.uc +++ b/lib/raid6/s390vx.uc @@ -11,6 +11,7 @@ * This file is postprocessed using unroll.awk. */ +#include #include #include