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

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 <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Heiko Carstens and committed by
Vasily Gorbik
db14f78e 52109a06

+6 -14
+2
arch/s390/boot/startup.c
··· 141 141 set_machine_feature(MFEATURE_TX); 142 142 local_ctl_set_bit(0, CR0_TRANSACTIONAL_EXECUTION_BIT); 143 143 } 144 + if (cpu_has_vx()) 145 + local_ctl_set_bit(0, CR0_VECTOR_BIT); 144 146 } 145 147 146 148 static int cmma_test_essa(void)
+1
arch/s390/include/asm/cpufeature.h
··· 31 31 #define cpu_has_seq_insn() test_facility(85) 32 32 #define cpu_has_tlb_lc() test_facility(51) 33 33 #define cpu_has_topology() test_facility(11) 34 + #define cpu_has_vx() test_facility(129) 34 35 35 36 #endif /* __ASM_S390_CPUFEATURE_H */
+1 -6
arch/s390/include/asm/fpu.h
··· 44 44 #ifndef _ASM_S390_FPU_H 45 45 #define _ASM_S390_FPU_H 46 46 47 + #include <linux/cpufeature.h> 47 48 #include <linux/processor.h> 48 49 #include <linux/preempt.h> 49 50 #include <linux/string.h> ··· 52 51 #include <asm/sigcontext.h> 53 52 #include <asm/fpu-types.h> 54 53 #include <asm/fpu-insn.h> 55 - #include <asm/facility.h> 56 - 57 - static inline bool cpu_has_vx(void) 58 - { 59 - return likely(test_facility(129)); 60 - } 61 54 62 55 enum { 63 56 KERNEL_FPC_BIT = 0,
+1 -8
arch/s390/kernel/early.c
··· 184 184 lc->return_mcck_lpswe = gen_lpswe(__LC_RETURN_MCCK_PSW); 185 185 } 186 186 187 - static __init void detect_machine_facilities(void) 188 - { 189 - if (test_facility(129)) 190 - system_ctl_set_bit(0, CR0_VECTOR_BIT); 191 - } 192 - 193 187 static inline void save_vector_registers(void) 194 188 { 195 189 #ifdef CONFIG_CRASH_DUMP 196 - if (test_facility(129)) 190 + if (cpu_has_vx()) 197 191 save_vx_regs(boot_cpu_vector_save_area); 198 192 #endif 199 193 } ··· 226 232 setup_lowcore_early(); 227 233 setup_arch_string(); 228 234 setup_boot_command_line(); 229 - detect_machine_facilities(); 230 235 save_vector_registers(); 231 236 setup_topology(); 232 237 sclp_early_detect();
+1
lib/raid6/s390vx.uc
··· 11 11 * This file is postprocessed using unroll.awk. 12 12 */ 13 13 14 + #include <linux/cpufeature.h> 14 15 #include <linux/raid/pq.h> 15 16 #include <asm/fpu.h> 16 17