Skip to content

Commit 09ac0e0

Browse files
hcahcagregkh
authored andcommitted
s390/pci: Fix __pcilg_mio_inuser() inline assembly
commit c4abe6234246c75cdc43326415d9cff88b7cf06c upstream. Use "a" constraint for the shift operand of the __pcilg_mio_inuser() inline assembly. The used "d" constraint allows the compiler to use any general purpose register for the shift operand, including register zero. If register zero is used this my result in incorrect code generation: 8f6: a7 0a ff f8 ahi %r0,-8 8fa: eb 32 00 00 00 0c srlg %r3,%r2,0 <---- If register zero is selected to contain the shift value, the srlg instruction ignores the contents of the register and always shifts zero bits. Therefore use the "a" constraint which does not permit to select register zero. Fixes: f058599 ("s390/pci: Fix s390_mmio_read/write with MIO") Cc: [email protected] Reported-by: Niklas Schnelle <[email protected]> Reviewed-by: Niklas Schnelle <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Niklas Schnelle <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e347edb commit 09ac0e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/pci/pci_mmio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static inline int __pcilg_mio_inuser(
223223
[ioaddr_len] "+&d" (ioaddr_len.pair),
224224
[cc] "+d" (cc), [val] "=d" (val),
225225
[dst] "+a" (dst), [cnt] "+d" (cnt), [tmp] "=d" (tmp),
226-
[shift] "+d" (shift)
226+
[shift] "+a" (shift)
227227
:: "cc", "memory");
228228

229229
/* did we write everything to the user space buffer? */

0 commit comments

Comments
 (0)