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

[S390] avoid STCKF if running in ESA mode

In ESA mode STCKF is not defined even if the facility bit is enabled.
To prevent an illegal operation we must also check if we run a 64 bit kernel.
To make the check perform well add the STCKF bit to the machine flags.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Jan Glauber and committed by
Martin Schwidefsky
cfa1e7e1 3f25dc4f

+6 -1
+3
arch/s390/include/asm/setup.h
··· 82 82 #define MACHINE_FLAG_LPAR (1UL << 12) 83 83 #define MACHINE_FLAG_SPP (1UL << 13) 84 84 #define MACHINE_FLAG_TOPOLOGY (1UL << 14) 85 + #define MACHINE_FLAG_STCKF (1UL << 15) 85 86 86 87 #define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM) 87 88 #define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM) ··· 101 100 #define MACHINE_HAS_PFMF (0) 102 101 #define MACHINE_HAS_SPP (0) 103 102 #define MACHINE_HAS_TOPOLOGY (0) 103 + #define MACHINE_HAS_STCKF (0) 104 104 #else /* __s390x__ */ 105 105 #define MACHINE_HAS_IEEE (1) 106 106 #define MACHINE_HAS_CSP (1) ··· 113 111 #define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF) 114 112 #define MACHINE_HAS_SPP (S390_lowcore.machine_flags & MACHINE_FLAG_SPP) 115 113 #define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY) 114 + #define MACHINE_HAS_STCKF (S390_lowcore.machine_flags & MACHINE_FLAG_STCKF) 116 115 #endif /* __s390x__ */ 117 116 118 117 #define ZFCPDUMP_HSA_SIZE (32UL<<20)
+1 -1
arch/s390/include/asm/timex.h
··· 90 90 { 91 91 unsigned long long clk; 92 92 93 - if (test_facility(25)) 93 + if (MACHINE_HAS_STCKF) 94 94 asm volatile(".insn s,0xb27c0000,%0" : "=Q" (clk) : : "cc"); 95 95 else 96 96 clk = get_clock();
+2
arch/s390/kernel/early.c
··· 390 390 S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS; 391 391 if (test_facility(40)) 392 392 S390_lowcore.machine_flags |= MACHINE_FLAG_SPP; 393 + if (test_facility(25)) 394 + S390_lowcore.machine_flags |= MACHINE_FLAG_STCKF; 393 395 #endif 394 396 } 395 397