Skip to content

Commit 1c29fb3

Browse files
hcahcaSasha Levin
authored and
Sasha Levin
committed
s390/facility: Disable compile time optimization for decompressor code
[ Upstream commit 0147add ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a591a4d commit 1c29fb3

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
@@ -53,8 +53,10 @@ static inline int test_facility(unsigned long nr)
5353
unsigned long facilities_als[] = { FACILITIES_ALS };
5454

5555
if (__builtin_constant_p(nr) && nr < sizeof(facilities_als) * 8) {
56-
if (__test_facility(nr, &facilities_als))
57-
return 1;
56+
if (__test_facility(nr, &facilities_als)) {
57+
if (!__is_defined(__DECOMPRESSOR))
58+
return 1;
59+
}
5860
}
5961
return __test_facility(nr, &S390_lowcore.stfle_fac_list);
6062
}

0 commit comments

Comments
 (0)