Skip to content

Commit 5623bc2

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/traps: Fix test_monitor_call() inline assembly
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: 17248ea ("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>
1 parent c3a589f commit 5623bc2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/s390/kernel/traps.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ static void __init test_monitor_call(void)
285285
return;
286286
asm volatile(
287287
" mc 0,0\n"
288-
"0: xgr %0,%0\n"
288+
"0: lhi %[val],0\n"
289289
"1:\n"
290-
EX_TABLE(0b,1b)
291-
: "+d" (val));
290+
EX_TABLE(0b, 1b)
291+
: [val] "+d" (val));
292292
if (!val)
293293
panic("Monitor call doesn't work!\n");
294294
}

0 commit comments

Comments
 (0)