Skip to content

Commit ebc2e91

Browse files
hcahcamehmetb0
authored andcommitted
s390/facility: Disable compile time optimization for decompressor code
BugLink: https://bugs.launchpad.net/bugs/2097301 [ 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 <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
1 parent c467dbc commit ebc2e91

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/s390/include/asm/facility.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ static inline int test_facility(unsigned long nr)
6060
unsigned long facilities_als[] = { FACILITIES_ALS };
6161

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

0 commit comments

Comments
 (0)