From 7e969afc80dfc5c32ee6eed718b5549deda424e0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 14 Apr 2014 15:35:40 -0700 Subject: [PATCH] 3.4-stable patches added patches: revert-sparc64-fix-__copy_-to-from-_user_inatomic-defines.patch sparc32-fix-build-failure-for-arch_jump_label_transform.patch sparc64-don-t-treat-64-bit-syscall-return-codes-as-32-bit.patch sparc-pci-fix-incorrect-address-calculation-of-pci-bridge-windows-on-simba-bridges.patch --- ...copy_-to-from-_user_inatomic-defines.patch | 42 +++++++++++++++++ queue-3.4/series | 4 ++ ...-pci-bridge-windows-on-simba-bridges.patch | 43 +++++++++++++++++ ...ailure-for-arch_jump_label_transform.patch | 44 +++++++++++++++++ ...4-bit-syscall-return-codes-as-32-bit.patch | 47 +++++++++++++++++++ 5 files changed, 180 insertions(+) create mode 100644 queue-3.4/revert-sparc64-fix-__copy_-to-from-_user_inatomic-defines.patch create mode 100644 queue-3.4/sparc-pci-fix-incorrect-address-calculation-of-pci-bridge-windows-on-simba-bridges.patch create mode 100644 queue-3.4/sparc32-fix-build-failure-for-arch_jump_label_transform.patch create mode 100644 queue-3.4/sparc64-don-t-treat-64-bit-syscall-return-codes-as-32-bit.patch diff --git a/queue-3.4/revert-sparc64-fix-__copy_-to-from-_user_inatomic-defines.patch b/queue-3.4/revert-sparc64-fix-__copy_-to-from-_user_inatomic-defines.patch new file mode 100644 index 00000000000..141d3878d33 --- /dev/null +++ b/queue-3.4/revert-sparc64-fix-__copy_-to-from-_user_inatomic-defines.patch @@ -0,0 +1,42 @@ +From foo@baz Mon Apr 14 15:35:09 PDT 2014 +From: Dave Kleikamp +Date: Mon, 16 Dec 2013 15:01:00 -0600 +Subject: Revert "sparc64: Fix __copy_{to,from}_user_inatomic defines." + +From: Dave Kleikamp + +[ Upstream commit 16932237f2978a2265662f8de4af743b1f55a209 ] + +This reverts commit 145e1c0023585e0e8f6df22316308ec61c5066b2. + +This commit broke the behavior of __copy_from_user_inatomic when +it is only partially successful. Instead of returning the number +of bytes not copied, it now returns 1. This translates to the +wrong value being returned by iov_iter_copy_from_user_atomic. + +xfstests generic/246 and LTP writev01 both fail on btrfs and nfs +because of this. + +Signed-off-by: Dave Kleikamp +Cc: Hugh Dickins +Cc: David S. Miller +Cc: sparclinux@vger.kernel.org +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/sparc/include/asm/uaccess_64.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/sparc/include/asm/uaccess_64.h ++++ b/arch/sparc/include/asm/uaccess_64.h +@@ -266,8 +266,8 @@ extern long __strnlen_user(const char __ + + #define strlen_user __strlen_user + #define strnlen_user __strnlen_user +-#define __copy_to_user_inatomic ___copy_to_user +-#define __copy_from_user_inatomic ___copy_from_user ++#define __copy_to_user_inatomic __copy_to_user ++#define __copy_from_user_inatomic __copy_from_user + + #endif /* __ASSEMBLY__ */ + diff --git a/queue-3.4/series b/queue-3.4/series index c028d10c919..97719f80cea 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -14,3 +14,7 @@ netlink-don-t-compare-the-nul-termination-in-nla_strcmp.patch isdnloop-validate-nul-terminated-strings-from-user.patch isdnloop-several-buffer-overflows.patch rds-prevent-dereference-of-a-null-device-in-rds_iw_laddr_check.patch +sparc-pci-fix-incorrect-address-calculation-of-pci-bridge-windows-on-simba-bridges.patch +revert-sparc64-fix-__copy_-to-from-_user_inatomic-defines.patch +sparc32-fix-build-failure-for-arch_jump_label_transform.patch +sparc64-don-t-treat-64-bit-syscall-return-codes-as-32-bit.patch diff --git a/queue-3.4/sparc-pci-fix-incorrect-address-calculation-of-pci-bridge-windows-on-simba-bridges.patch b/queue-3.4/sparc-pci-fix-incorrect-address-calculation-of-pci-bridge-windows-on-simba-bridges.patch new file mode 100644 index 00000000000..f39165802b9 --- /dev/null +++ b/queue-3.4/sparc-pci-fix-incorrect-address-calculation-of-pci-bridge-windows-on-simba-bridges.patch @@ -0,0 +1,43 @@ +From foo@baz Mon Apr 14 15:35:09 PDT 2014 +From: oftedal +Date: Fri, 18 Oct 2013 22:28:29 +0200 +Subject: sparc: PCI: Fix incorrect address calculation of PCI Bridge windows on Simba-bridges + +From: oftedal + +[ Upstream commit 557fc5873ef178c4b3e1e36a42db547ecdc43f9b ] + +The SIMBA APB Bridges lacks the 'ranges' of-property describing the +PCI I/O and memory areas located beneath the bridge. Faking this +information has been performed by reading range registers in the +APB bridge, and calculating the corresponding areas. + +In commit 01f94c4a6ced476ce69b895426fc29bfc48c69bd +("Fix sabre pci controllers with new probing scheme.") a bug was +introduced into this calculation, causing the PCI memory areas +to be calculated incorrectly: The shift size was set to be +identical for I/O and MEM ranges, which is incorrect. + +This patch set the shift size of the MEM range back to the +value used before 01f94c4a6ced476ce69b895426fc29bfc48c69bd. + +Signed-off-by: Kjetil Oftedal +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/sparc/kernel/pci.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/sparc/kernel/pci.c ++++ b/arch/sparc/kernel/pci.c +@@ -486,8 +486,8 @@ static void __devinit apb_fake_ranges(st + apb_calc_first_last(map, &first, &last); + res = bus->resource[1]; + res->flags = IORESOURCE_MEM; +- region.start = (first << 21); +- region.end = (last << 21) + ((1 << 21) - 1); ++ region.start = (first << 29); ++ region.end = (last << 29) + ((1 << 29) - 1); + pcibios_bus_to_resource(dev, res, ®ion); + } + diff --git a/queue-3.4/sparc32-fix-build-failure-for-arch_jump_label_transform.patch b/queue-3.4/sparc32-fix-build-failure-for-arch_jump_label_transform.patch new file mode 100644 index 00000000000..1ce20698b20 --- /dev/null +++ b/queue-3.4/sparc32-fix-build-failure-for-arch_jump_label_transform.patch @@ -0,0 +1,44 @@ +From foo@baz Mon Apr 14 15:35:09 PDT 2014 +From: Paul Gortmaker +Date: Thu, 13 Feb 2014 13:57:44 -0500 +Subject: sparc32: fix build failure for arch_jump_label_transform + +From: Paul Gortmaker + +[ Upstream commit 4f6500fff5f7644a03c46728fd7ef0f62fa6940b ] + +In arch/sparc/Kernel/Makefile, we see: + + obj-$(CONFIG_SPARC64) += jump_label.o + +However, the Kconfig selects HAVE_ARCH_JUMP_LABEL unconditionally +for all SPARC. This in turn leads to the following failure when +doing allmodconfig coverage builds: + +kernel/built-in.o: In function `__jump_label_update': +jump_label.c:(.text+0x8560c): undefined reference to `arch_jump_label_transform' +kernel/built-in.o: In function `arch_jump_label_transform_static': +(.text+0x85cf4): undefined reference to `arch_jump_label_transform' +make: *** [vmlinux] Error 1 + +Change HAVE_ARCH_JUMP_LABEL to be conditional on SPARC64 so that it +matches the Makefile. + +Signed-off-by: Paul Gortmaker +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/sparc/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/sparc/Kconfig ++++ b/arch/sparc/Kconfig +@@ -24,7 +24,7 @@ config SPARC + select HAVE_IRQ_WORK + select HAVE_DMA_ATTRS + select HAVE_DMA_API_DEBUG +- select HAVE_ARCH_JUMP_LABEL ++ select HAVE_ARCH_JUMP_LABEL if SPARC64 + select HAVE_GENERIC_HARDIRQS + select GENERIC_IRQ_SHOW + select USE_GENERIC_SMP_HELPERS if SMP diff --git a/queue-3.4/sparc64-don-t-treat-64-bit-syscall-return-codes-as-32-bit.patch b/queue-3.4/sparc64-don-t-treat-64-bit-syscall-return-codes-as-32-bit.patch new file mode 100644 index 00000000000..a0ba640998d --- /dev/null +++ b/queue-3.4/sparc64-don-t-treat-64-bit-syscall-return-codes-as-32-bit.patch @@ -0,0 +1,47 @@ +From foo@baz Mon Apr 14 15:35:09 PDT 2014 +From: Dave Kleikamp +Date: Fri, 14 Mar 2014 10:42:01 -0500 +Subject: sparc64: don't treat 64-bit syscall return codes as 32-bit + +From: Dave Kleikamp + +[ Upstream commit 1535bd8adbdedd60a0ee62e28fd5225d66434371 ] + +When checking a system call return code for an error, +linux_sparc_syscall was sign-extending the lower 32-bit value and +comparing it to -ERESTART_RESTARTBLOCK. lseek can return valid return +codes whose lower 32-bits alone would indicate a failure (such as 4G-1). +Use the whole 64-bit value to check for errors. Only the 32-bit path +should sign extend the lower 32-bit value. + +Signed-off-by: Dave Kleikamp +Acked-by: Bob Picco +Acked-by: Allen Pais +Cc: David S. Miller +Cc: sparclinux@vger.kernel.org +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + arch/sparc/kernel/syscalls.S | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/sparc/kernel/syscalls.S ++++ b/arch/sparc/kernel/syscalls.S +@@ -184,7 +184,8 @@ linux_sparc_syscall32: + mov %i0, %l5 ! IEU1 + 5: call %l7 ! CTI Group brk forced + srl %i5, 0, %o5 ! IEU1 +- ba,a,pt %xcc, 3f ++ ba,pt %xcc, 3f ++ sra %o0, 0, %o0 + + /* Linux native system calls enter here... */ + .align 32 +@@ -212,7 +213,6 @@ linux_sparc_syscall: + 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] + ret_sys_call: + ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 +- sra %o0, 0, %o0 + mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 + sllx %g2, 32, %g2 + -- 2.47.3