Skip to content

Commit 845590b

Browse files
hcahcagregkh
authored andcommitted
s390/traps: Fix test_monitor_call() inline assembly
commit 5623bc2 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: 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8373245 commit 845590b

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
@@ -284,10 +284,10 @@ static void __init test_monitor_call(void)
284284
return;
285285
asm volatile(
286286
" mc 0,0\n"
287-
"0: xgr %0,%0\n"
287+
"0: lhi %[val],0\n"
288288
"1:\n"
289-
EX_TABLE(0b,1b)
290-
: "+d" (val));
289+
EX_TABLE(0b, 1b)
290+
: [val] "+d" (val));
291291
if (!val)
292292
panic("Monitor call doesn't work!\n");
293293
}

0 commit comments

Comments
 (0)