Skip to content

Commit 0147add

Browse files
committed
s390/facility: Disable compile time optimization for decompressor code
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 <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent db545f5 commit 0147add

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/s390/include/asm/facility.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ static inline int test_facility(unsigned long nr)
5959
unsigned long facilities_als[] = { FACILITIES_ALS };
6060

6161
if (__builtin_constant_p(nr) && nr < sizeof(facilities_als) * 8) {
62-
if (__test_facility(nr, &facilities_als))
63-
return 1;
62+
if (__test_facility(nr, &facilities_als)) {
63+
if (!__is_defined(__DECOMPRESSOR))
64+
return 1;
65+
}
6466
}
6567
return __test_facility(nr, &stfle_fac_list);
6668
}

0 commit comments

Comments
 (0)