Skip to content

Commit 0a50182

Browse files
hcahcagregkh
authored andcommitted
s390/cio/ioasm: Fix __xsch() condition code handling
commit f0edc8f upstream. For the __xsch() inline assembly the conversion to flag output macros is incomplete. Only the conditional shift of the return value was added, while the required changes to the inline assembly itself are missing. If compiled with GCC versions before 14.2 this leads to a double shift of the cc output operand and therefore the returned value of __xsch() is incorrectly always zero, instead of the expected condition code. Fixes: e200565 ("s390/cio/ioasm: Convert to use flag output macros") Cc: [email protected] Signed-off-by: Heiko Carstens <[email protected]> Acked-by: Alexander Gordeev <[email protected]> Reviewed-by: Juergen Christ <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c511713 commit 0a50182

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/s390/cio/ioasm.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,10 @@ static inline int __xsch(struct subchannel_id schid)
253253
asm volatile(
254254
" lgr 1,%[r1]\n"
255255
" xsch\n"
256-
" ipm %[cc]\n"
257-
" srl %[cc],28\n"
258-
: [cc] "=&d" (ccode)
256+
CC_IPM(cc)
257+
: CC_OUT(cc, ccode)
259258
: [r1] "d" (r1)
260-
: "cc", "1");
259+
: CC_CLOBBER_LIST("1"));
261260
return CC_TRANSFORM(ccode);
262261
}
263262

0 commit comments

Comments
 (0)