From: Greg Kroah-Hartman Date: Tue, 5 Jun 2018 10:20:51 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v4.9.107~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b68a12144d20f8e5d9e3134fa7e9dbd32d0f97f6;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: sparc64-add-__multi3-for-gcc-7.x-and-later.patch sparc64-don-t-clibber-fixed-registers-in-__multi4.patch --- diff --git a/queue-4.4/series b/queue-4.4/series index 1f932a1956d..733e25bd6ff 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -32,4 +32,6 @@ drm-i915-disable-lvds-on-radiant-p845.patch kbuild-change-cc_optimize_for_size-definition.patch fix-io_destroy-aio_complete-race.patch mm-fix-the-null-mapping-case-in-__isolate_lru_page.patch +sparc64-add-__multi3-for-gcc-7.x-and-later.patch +sparc64-don-t-clibber-fixed-registers-in-__multi4.patch sparc64-fix-build-warnings-with-gcc-7.patch diff --git a/queue-4.4/sparc64-add-__multi3-for-gcc-7.x-and-later.patch b/queue-4.4/sparc64-add-__multi3-for-gcc-7.x-and-later.patch new file mode 100644 index 00000000000..0e4d46c94dc --- /dev/null +++ b/queue-4.4/sparc64-add-__multi3-for-gcc-7.x-and-later.patch @@ -0,0 +1,67 @@ +From 1b4af13ff2cc6897557bb0b8d9e2fad4fa4d67aa Mon Sep 17 00:00:00 2001 +From: "David S. Miller" +Date: Mon, 5 Jun 2017 11:28:57 -0700 +Subject: sparc64: Add __multi3 for gcc 7.x and later. + +From: David S. Miller + +commit 1b4af13ff2cc6897557bb0b8d9e2fad4fa4d67aa upstream. + +Reported-by: Waldemar Brodkorb +Signed-off-by: David S. Miller +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + arch/sparc/lib/Makefile | 1 + + arch/sparc/lib/multi3.S | 35 +++++++++++++++++++++++++++++++++++ + 2 files changed, 36 insertions(+) + +--- a/arch/sparc/lib/Makefile ++++ b/arch/sparc/lib/Makefile +@@ -15,6 +15,7 @@ lib-$(CONFIG_SPARC32) += copy_user.o loc + lib-$(CONFIG_SPARC64) += atomic_64.o + lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o + lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o ++lib-$(CONFIG_SPARC64) += multi3.o + + lib-$(CONFIG_SPARC64) += copy_page.o clear_page.o bzero.o + lib-$(CONFIG_SPARC64) += csum_copy.o csum_copy_from_user.o csum_copy_to_user.o +--- /dev/null ++++ b/arch/sparc/lib/multi3.S +@@ -0,0 +1,35 @@ ++#include ++#include ++ ++ .text ++ .align 4 ++ENTRY(__multi3) /* %o0 = u, %o1 = v */ ++ mov %o1, %g1 ++ srl %o3, 0, %g4 ++ mulx %g4, %g1, %o1 ++ srlx %g1, 0x20, %g3 ++ mulx %g3, %g4, %g5 ++ sllx %g5, 0x20, %o5 ++ srl %g1, 0, %g4 ++ sub %o1, %o5, %o5 ++ srlx %o5, 0x20, %o5 ++ addcc %g5, %o5, %g5 ++ srlx %o3, 0x20, %o5 ++ mulx %g4, %o5, %g4 ++ mulx %g3, %o5, %o5 ++ sethi %hi(0x80000000), %g3 ++ addcc %g5, %g4, %g5 ++ srlx %g5, 0x20, %g5 ++ add %g3, %g3, %g3 ++ movcc %xcc, %g0, %g3 ++ addcc %o5, %g5, %o5 ++ sllx %g4, 0x20, %g4 ++ add %o1, %g4, %o1 ++ add %o5, %g3, %g2 ++ mulx %g1, %o2, %g1 ++ add %g1, %g2, %g1 ++ mulx %o0, %o3, %o0 ++ retl ++ add %g1, %o0, %o0 ++ENDPROC(__multi3) ++EXPORT_SYMBOL(__multi3) diff --git a/queue-4.4/sparc64-don-t-clibber-fixed-registers-in-__multi4.patch b/queue-4.4/sparc64-don-t-clibber-fixed-registers-in-__multi4.patch new file mode 100644 index 00000000000..1f5cce8269c --- /dev/null +++ b/queue-4.4/sparc64-don-t-clibber-fixed-registers-in-__multi4.patch @@ -0,0 +1,66 @@ +From 79db795833bf5c3e798bcd7a5aeeee3fb0505927 Mon Sep 17 00:00:00 2001 +From: "David S. Miller" +Date: Tue, 15 Aug 2017 21:32:19 -0700 +Subject: sparc64: Don't clibber fixed registers in __multi4. + +From: David S. Miller + +commit 79db795833bf5c3e798bcd7a5aeeee3fb0505927 upstream. + +%g4 and %g5 are fixed registers used by the kernel for the thread +pointer and the per-cpu offset. Use %o4 and %g7 instead. + +Diagnosis by Anthony Yznaga. + +Fixes: 1b4af13ff2cc ("sparc64: Add __multi3 for gcc 7.x and later.") +Reported-by: Anatoly Pugachev +Tested-by: Anatoly Pugachev +Signed-off-by: David S. Miller +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + arch/sparc/lib/multi3.S | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +--- a/arch/sparc/lib/multi3.S ++++ b/arch/sparc/lib/multi3.S +@@ -5,26 +5,26 @@ + .align 4 + ENTRY(__multi3) /* %o0 = u, %o1 = v */ + mov %o1, %g1 +- srl %o3, 0, %g4 +- mulx %g4, %g1, %o1 ++ srl %o3, 0, %o4 ++ mulx %o4, %g1, %o1 + srlx %g1, 0x20, %g3 +- mulx %g3, %g4, %g5 +- sllx %g5, 0x20, %o5 +- srl %g1, 0, %g4 ++ mulx %g3, %o4, %g7 ++ sllx %g7, 0x20, %o5 ++ srl %g1, 0, %o4 + sub %o1, %o5, %o5 + srlx %o5, 0x20, %o5 +- addcc %g5, %o5, %g5 ++ addcc %g7, %o5, %g7 + srlx %o3, 0x20, %o5 +- mulx %g4, %o5, %g4 ++ mulx %o4, %o5, %o4 + mulx %g3, %o5, %o5 + sethi %hi(0x80000000), %g3 +- addcc %g5, %g4, %g5 +- srlx %g5, 0x20, %g5 ++ addcc %g7, %o4, %g7 ++ srlx %g7, 0x20, %g7 + add %g3, %g3, %g3 + movcc %xcc, %g0, %g3 +- addcc %o5, %g5, %o5 +- sllx %g4, 0x20, %g4 +- add %o1, %g4, %o1 ++ addcc %o5, %g7, %o5 ++ sllx %o4, 0x20, %o4 ++ add %o1, %o4, %o1 + add %o5, %g3, %g2 + mulx %g1, %o2, %g1 + add %g1, %g2, %g1