Commit 26d49596 authored by Heiko Carstens's avatar Heiko Carstens Committed by Jason A. Donenfeld
Browse files

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: default avatarSven Schnelle <svens@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
parent a6e23fb8
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -59,9 +59,11 @@ 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))
		if (__test_facility(nr, &facilities_als)) {
			if (!__is_defined(__DECOMPRESSOR))
				return 1;
		}
	}
	return __test_facility(nr, &stfle_fac_list);
}