summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2025-02-25 10:53:10 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-13 12:58:27 +0100
commit272abd47f7d25b5c69a3428576c30428fd8c49d4 (patch)
treee790194a572757d9212a2771e547bea151f101c1 /arch
parent18519478b9a0a66ea66a8ca6a88765fed1c8f0b3 (diff)
downloadlinux-272abd47f7d25b5c69a3428576c30428fd8c49d4.tar.gz
linux-272abd47f7d25b5c69a3428576c30428fd8c49d4.tar.bz2
linux-272abd47f7d25b5c69a3428576c30428fd8c49d4.zip
s390/traps: Fix test_monitor_call() inline assembly
commit 5623bc23a1cb9f9a9470fa73b3a20321dc4c4870 upstream. The test_monitor_call() inline assembly uses the xgr instruction, which also modifies the condition code, to clear a register. However the clobber list of the inline assembly does not specify that the condition code is modified, which may lead to incorrect code generation. Use the lhi instruction instead to clear the register without that the condition code is modified. Furthermore this limits clearing to the lower 32 bits of val, since its type is int. Fixes: 17248ea03674 ("s390: fix __EMIT_BUG() macro") Cc: stable@vger.kernel.org Reviewed-by: Juergen Christ <jchrist@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/kernel/traps.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 1d2aa448d103..bfedbd7fae3b 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -276,10 +276,10 @@ static void __init test_monitor_call(void)
return;
asm volatile(
" mc 0,0\n"
- "0: xgr %0,%0\n"
+ "0: lhi %[val],0\n"
"1:\n"
- EX_TABLE(0b,1b)
- : "+d" (val));
+ EX_TABLE(0b, 1b)
+ : [val] "+d" (val));
if (!val)
panic("Monitor call doesn't work!\n");
}