]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
s390/boot: Fix ESSA detection
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 18 Feb 2025 11:11:34 +0000 (12:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Feb 2025 12:34:20 +0000 (04:34 -0800)
commit c3a589fd9fcbf295a7402a4b188dc9277d505f4f upstream.

The cmma_test_essa() inline assembly uses tmp as input and output, however
tmp is specified as output only, which allows the compiler to optimize the
initialization of tmp away.

Therefore the ESSA detection may or may not work depending on previous
contents of the register that the compiler selected for tmp.

Fix this by using the correct constraint modifier.

Fixes: 468a3bc2b7b9 ("s390/cmma: move parsing of cmma kernel parameter to early boot code")
Cc: stable@vger.kernel.org
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/boot/startup.c

index 6087d38c7235122a0d77d4c77d3ca96c2409c8bd..ea56a6492c81bd195c5edfd6c8843352653a66ce 100644 (file)
@@ -75,7 +75,7 @@ static int cmma_test_essa(void)
                : [reg1] "=&d" (reg1),
                  [reg2] "=&a" (reg2),
                  [rc] "+&d" (rc),
-                 [tmp] "=&d" (tmp),
+                 [tmp] "+&d" (tmp),
                  "+Q" (get_lowcore()->program_new_psw),
                  "=Q" (old)
                : [psw_old] "a" (&old),