From: Greg Kroah-Hartman Date: Mon, 23 Jun 2025 11:16:01 +0000 (+0200) Subject: 5.15-stable patches X-Git-Tag: v5.4.295~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34f428f3cb019098d7cda97c8692dc8b318fa6de;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: s390-pci-fix-__pcilg_mio_inuser-inline-assembly.patch --- diff --git a/queue-5.15/s390-pci-fix-__pcilg_mio_inuser-inline-assembly.patch b/queue-5.15/s390-pci-fix-__pcilg_mio_inuser-inline-assembly.patch new file mode 100644 index 0000000000..7fe86eb53a --- /dev/null +++ b/queue-5.15/s390-pci-fix-__pcilg_mio_inuser-inline-assembly.patch @@ -0,0 +1,45 @@ +From c4abe6234246c75cdc43326415d9cff88b7cf06c Mon Sep 17 00:00:00 2001 +From: Heiko Carstens +Date: Mon, 19 May 2025 18:07:11 +0200 +Subject: s390/pci: Fix __pcilg_mio_inuser() inline assembly + +From: Heiko Carstens + +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: f058599e22d5 ("s390/pci: Fix s390_mmio_read/write with MIO") +Cc: stable@vger.kernel.org +Reported-by: Niklas Schnelle +Reviewed-by: Niklas Schnelle +Signed-off-by: Heiko Carstens +Signed-off-by: Niklas Schnelle +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/pci/pci_mmio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/s390/pci/pci_mmio.c ++++ b/arch/s390/pci/pci_mmio.c +@@ -222,7 +222,7 @@ static inline int __pcilg_mio_inuser( + [ioaddr_len] "+&d" (ioaddr_len.pair), + [cc] "+d" (cc), [val] "=d" (val), + [dst] "+a" (dst), [cnt] "+d" (cnt), [tmp] "=d" (tmp), +- [shift] "+d" (shift) ++ [shift] "+a" (shift) + :: "cc", "memory"); + + /* did we write everything to the user space buffer? */ diff --git a/queue-5.15/series b/queue-5.15/series index fd9b42ca3a..b831d5cf5f 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -406,3 +406,4 @@ ext4-make-abort-mount-option-handling-standard.patch ext4-avoid-remount-errors-with-abort-mount-option.patch net-fix-checksum-update-for-ila-adj-transport.patch bpf-fix-l4-csum-update-on-ipv6-in-checksum_complete.patch +s390-pci-fix-__pcilg_mio_inuser-inline-assembly.patch