]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Jun 2025 11:28:17 +0000 (13:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Jun 2025 11:42:04 +0000 (13:42 +0200)
added patches:
s390-pci-fix-__pcilg_mio_inuser-inline-assembly.patch

queue-5.4/s390-pci-fix-__pcilg_mio_inuser-inline-assembly.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/s390-pci-fix-__pcilg_mio_inuser-inline-assembly.patch b/queue-5.4/s390-pci-fix-__pcilg_mio_inuser-inline-assembly.patch
new file mode 100644 (file)
index 0000000..28b409e
--- /dev/null
@@ -0,0 +1,45 @@
+From c4abe6234246c75cdc43326415d9cff88b7cf06c Mon Sep 17 00:00:00 2001
+From: Heiko Carstens <hca@linux.ibm.com>
+Date: Mon, 19 May 2025 18:07:11 +0200
+Subject: s390/pci: Fix __pcilg_mio_inuser() inline assembly
+
+From: Heiko Carstens <hca@linux.ibm.com>
+
+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 <schnelle@linux.ibm.com>
+Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
+Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
+Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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
+@@ -227,7 +227,7 @@ static inline int __pcilg_mio_inuser(
+               :
+               [cc] "+d" (cc), [val] "=d" (val), [len] "+d" (len),
+               [dst] "+a" (dst), [cnt] "+d" (cnt), [tmp] "=d" (tmp),
+-              [shift] "+d" (shift)
++              [shift] "+a" (shift)
+               :
+               [ioaddr] "a" (addr)
+               : "cc", "memory");
index 0e02dc1f37982b80605f519d92225fbb1835e755..9fd9a88c5e80f7e9e4f5f2e781437383526cb513 100644 (file)
@@ -217,3 +217,4 @@ rtc-make-rtc_time64_to_tm-support-dates-before-1970.patch
 mm-huge_memory-fix-dereferencing-invalid-pmd-migration-entry.patch
 jbd2-fix-data-race-and-null-ptr-deref-in-jbd2_journal_dirty_metadata.patch
 rtc-test-fix-invalid-format-specifier.patch
+s390-pci-fix-__pcilg_mio_inuser-inline-assembly.patch