diff options
| author | Heiko Carstens <hca@linux.ibm.com> | 2024-09-04 11:39:24 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-17 15:08:30 +0200 |
| commit | 1cd197813eb85905b54a7efd34abb9d110fffe2a (patch) | |
| tree | f479d95f25ef8859053b2bfdf4ab62a3a3fbf3f8 /arch/s390 | |
| parent | 029aa36ba33253f27d70e3123fc3495ab0326b7e (diff) | |
| download | linux-1cd197813eb85905b54a7efd34abb9d110fffe2a.tar.gz linux-1cd197813eb85905b54a7efd34abb9d110fffe2a.tar.bz2 linux-1cd197813eb85905b54a7efd34abb9d110fffe2a.zip | |
s390/facility: Disable compile time optimization for decompressor code
[ Upstream commit 0147addc4fb72a39448b8873d8acdf3a0f29aa65 ]
Disable compile time optimizations of test_facility() for the
decompressor. The decompressor should not contain any optimized code
depending on the architecture level set the kernel image is compiled
for to avoid unexpected operation exceptions.
Add a __DECOMPRESSOR check to test_facility() to enforce that
facilities are always checked during runtime for the decompressor.
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/s390')
| -rw-r--r-- | arch/s390/include/asm/facility.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/s390/include/asm/facility.h b/arch/s390/include/asm/facility.h index 68c476b20b57..c7031d9ada29 100644 --- a/arch/s390/include/asm/facility.h +++ b/arch/s390/include/asm/facility.h @@ -53,8 +53,10 @@ static inline int test_facility(unsigned long nr) unsigned long facilities_als[] = { FACILITIES_ALS }; if (__builtin_constant_p(nr) && nr < sizeof(facilities_als) * 8) { - if (__test_facility(nr, &facilities_als)) - return 1; + if (__test_facility(nr, &facilities_als)) { + if (!__is_defined(__DECOMPRESSOR)) + return 1; + } } return __test_facility(nr, &S390_lowcore.stfle_fac_list); } |
