]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
s390/boot: Fix ESSA detection
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 18 Feb 2025 11:11:34 +0000 (12:11 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 18 Feb 2025 17:49:24 +0000 (18:49 +0100)
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>
arch/s390/boot/startup.c

index 885bd1dd2c82f948199ae369077aba4e0bf8020b..9276e0576d0ab5bc0ce5cca4329de017f233a64c 100644 (file)
@@ -86,7 +86,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),