]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop mips patch from everywhere
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 May 2021 18:56:41 +0000 (20:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 May 2021 18:56:41 +0000 (20:56 +0200)
16 files changed:
queue-4.14/mips-reinstate-platform-__div64_32-handler.patch [deleted file]
queue-4.14/series
queue-4.19/mips-reinstate-platform-__div64_32-handler.patch [deleted file]
queue-4.19/series
queue-4.4/mips-reinstate-platform-__div64_32-handler.patch [deleted file]
queue-4.4/series
queue-4.9/mips-reinstate-platform-__div64_32-handler.patch [deleted file]
queue-4.9/series
queue-5.10/mips-reinstate-platform-__div64_32-handler.patch [deleted file]
queue-5.10/series
queue-5.11/mips-reinstate-platform-__div64_32-handler.patch [deleted file]
queue-5.11/series
queue-5.12/mips-reinstate-platform-__div64_32-handler.patch [deleted file]
queue-5.12/series
queue-5.4/mips-reinstate-platform-__div64_32-handler.patch [deleted file]
queue-5.4/series

diff --git a/queue-4.14/mips-reinstate-platform-__div64_32-handler.patch b/queue-4.14/mips-reinstate-platform-__div64_32-handler.patch
deleted file mode 100644 (file)
index 3a0267d..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-From c49f71f60754acbff37505e1d16ca796bf8a8140 Mon Sep 17 00:00:00 2001
-From: "Maciej W. Rozycki" <macro@orcam.me.uk>
-Date: Tue, 20 Apr 2021 04:50:40 +0200
-Subject: MIPS: Reinstate platform `__div64_32' handler
-
-From: Maciej W. Rozycki <macro@orcam.me.uk>
-
-commit c49f71f60754acbff37505e1d16ca796bf8a8140 upstream.
-
-Our current MIPS platform `__div64_32' handler is inactive, because it
-is incorrectly only enabled for 64-bit configurations, for which generic
-`do_div' code does not call it anyway.
-
-The handler is not suitable for being called from there though as it
-only calculates 32 bits of the quotient under the assumption the 64-bit
-divident has been suitably reduced.  Code for such reduction used to be
-there, however it has been incorrectly removed with commit c21004cd5b4c
-("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0."), which should
-have only updated an obsoleted constraint for an inline asm involving
-$hi and $lo register outputs, while possibly wiring the original MIPS
-variant of the `do_div' macro as `__div64_32' handler for the generic
-`do_div' implementation
-
-Correct the handler as follows then:
-
-- Revert most of the commit referred, however retaining the current
-  formatting, except for the final two instructions of the inline asm
-  sequence, which the original commit missed.  Omit the original 64-bit
-  parts though.
-
-- Rename the original `do_div' macro to `__div64_32'.  Use the combined
-  `x' constraint referring to the MD accumulator as a whole, replacing
-  the original individual `h' and `l' constraints used for $hi and $lo
-  registers respectively, of which `h' has been obsoleted with GCC 4.4.
-  Update surrounding code accordingly.
-
-  We have since removed support for GCC versions before 4.9, so no need
-  for a special arrangement here; GCC has supported the `x' constraint
-  since forever anyway, or at least going back to 1991.
-
-- Rename the `__base' local variable in `__div64_32' to `__radix' to
-  avoid a conflict with a local variable in `do_div'.
-
-- Actually enable this code for 32-bit rather than 64-bit configurations
-  by qualifying it with BITS_PER_LONG being 32 instead of 64.  Include
-  <asm/bitsperlong.h> for this macro rather than <linux/types.h> as we
-  don't need anything else.
-
-- Finally include <asm-generic/div64.h> last rather than first.
-
-This has passed correctness verification with test_div64 and reduced the
-module's average execution time down to 1.0668s and 0.2629s from 2.1529s
-and 0.5647s respectively for an R3400 CPU @40MHz and a 5Kc CPU @160MHz.
-For a reference 64-bit `do_div' code where we have the DDIVU instruction
-available to do the whole calculation right away averages at 0.0660s for
-the latter CPU.
-
-Fixes: c21004cd5b4c ("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0.")
-Reported-by: Huacai Chen <chenhuacai@kernel.org>
-Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
-Cc: stable@vger.kernel.org # v2.6.30+
-Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- arch/mips/include/asm/div64.h |   57 ++++++++++++++++++++++++++++++------------
- 1 file changed, 41 insertions(+), 16 deletions(-)
-
---- a/arch/mips/include/asm/div64.h
-+++ b/arch/mips/include/asm/div64.h
-@@ -1,5 +1,5 @@
- /*
-- * Copyright (C) 2000, 2004  Maciej W. Rozycki
-+ * Copyright (C) 2000, 2004, 2021  Maciej W. Rozycki
-  * Copyright (C) 2003, 07 Ralf Baechle (ralf@linux-mips.org)
-  *
-  * This file is subject to the terms and conditions of the GNU General Public
-@@ -9,25 +9,18 @@
- #ifndef __ASM_DIV64_H
- #define __ASM_DIV64_H
--#include <asm-generic/div64.h>
--
--#if BITS_PER_LONG == 64
-+#include <asm/bitsperlong.h>
--#include <linux/types.h>
-+#if BITS_PER_LONG == 32
- /*
-  * No traps on overflows for any of these...
-  */
--#define __div64_32(n, base)                                           \
--({                                                                    \
-+#define do_div64_32(res, high, low, base) ({                          \
-       unsigned long __cf, __tmp, __tmp2, __i;                         \
-       unsigned long __quot32, __mod32;                                \
--      unsigned long __high, __low;                                    \
--      unsigned long long __n;                                         \
-                                                                       \
--      __high = *__n >> 32;                                            \
--      __low = __n;                                                    \
-       __asm__(                                                        \
-       "       .set    push                                    \n"     \
-       "       .set    noat                                    \n"     \
-@@ -51,18 +44,50 @@
-       "       subu    %0, %0, %z6                             \n"     \
-       "       addiu   %2, %2, 1                               \n"     \
-       "3:                                                     \n"     \
--      "       bnez    %4, 0b\n\t"                                     \
--      "        srl    %5, %1, 0x1f\n\t"                               \
-+      "       bnez    %4, 0b                                  \n"     \
-+      "        srl    %5, %1, 0x1f                            \n"     \
-       "       .set    pop"                                            \
-       : "=&r" (__mod32), "=&r" (__tmp),                               \
-         "=&r" (__quot32), "=&r" (__cf),                               \
-         "=&r" (__i), "=&r" (__tmp2)                                   \
--      : "Jr" (base), "0" (__high), "1" (__low));                      \
-+      : "Jr" (base), "0" (high), "1" (low));                          \
-                                                                       \
--      (__n) = __quot32;                                               \
-+      (res) = __quot32;                                               \
-       __mod32;                                                        \
- })
--#endif /* BITS_PER_LONG == 64 */
-+#define __div64_32(n, base) ({                                                \
-+      unsigned long __upper, __low, __high, __radix;                  \
-+      unsigned long long __modquot;                                   \
-+      unsigned long long __quot;                                      \
-+      unsigned long long __div;                                       \
-+      unsigned long __mod;                                            \
-+                                                                      \
-+      __div = (*n);                                                   \
-+      __radix = (base);                                               \
-+                                                                      \
-+      __high = __div >> 32;                                           \
-+      __low = __div;                                                  \
-+      __upper = __high;                                               \
-+                                                                      \
-+      if (__high) {                                                   \
-+              __asm__("divu   $0, %z1, %z2"                           \
-+              : "=x" (__modquot)                                      \
-+              : "Jr" (__high), "Jr" (__radix));                       \
-+              __upper = __modquot >> 32;                              \
-+              __high = __modquot;                                     \
-+      }                                                               \
-+                                                                      \
-+      __mod = do_div64_32(__low, __upper, __low, __radix);            \
-+                                                                      \
-+      __quot = __high;                                                \
-+      __quot = __quot << 32 | __low;                                  \
-+      (*n) = __quot;                                                  \
-+      __mod;                                                          \
-+})
-+
-+#endif /* BITS_PER_LONG == 32 */
-+
-+#include <asm-generic/div64.h>
- #endif /* __ASM_DIV64_H */
index 0b000a4e935727379517043a88bf3f0270731014..afb42ec0b155992f8145552faba85c0f1a2d82ca 100644 (file)
@@ -122,7 +122,6 @@ md-cluster-fix-use-after-free-issue-when-removing-rdev.patch
 md-split-mddev_find.patch
 md-factor-out-a-mddev_find_locked-helper-from-mddev_find.patch
 md-md_open-returns-ebusy-when-entering-racing-area.patch
-mips-reinstate-platform-__div64_32-handler.patch
 ipw2x00-potential-buffer-overflow-in-libipw_wx_set_encodeext.patch
 cfg80211-scan-drop-entry-from-hidden_list-on-overflow.patch
 drm-radeon-fix-copy-of-uninitialized-variable-back-to-userspace.patch
diff --git a/queue-4.19/mips-reinstate-platform-__div64_32-handler.patch b/queue-4.19/mips-reinstate-platform-__div64_32-handler.patch
deleted file mode 100644 (file)
index 3a0267d..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-From c49f71f60754acbff37505e1d16ca796bf8a8140 Mon Sep 17 00:00:00 2001
-From: "Maciej W. Rozycki" <macro@orcam.me.uk>
-Date: Tue, 20 Apr 2021 04:50:40 +0200
-Subject: MIPS: Reinstate platform `__div64_32' handler
-
-From: Maciej W. Rozycki <macro@orcam.me.uk>
-
-commit c49f71f60754acbff37505e1d16ca796bf8a8140 upstream.
-
-Our current MIPS platform `__div64_32' handler is inactive, because it
-is incorrectly only enabled for 64-bit configurations, for which generic
-`do_div' code does not call it anyway.
-
-The handler is not suitable for being called from there though as it
-only calculates 32 bits of the quotient under the assumption the 64-bit
-divident has been suitably reduced.  Code for such reduction used to be
-there, however it has been incorrectly removed with commit c21004cd5b4c
-("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0."), which should
-have only updated an obsoleted constraint for an inline asm involving
-$hi and $lo register outputs, while possibly wiring the original MIPS
-variant of the `do_div' macro as `__div64_32' handler for the generic
-`do_div' implementation
-
-Correct the handler as follows then:
-
-- Revert most of the commit referred, however retaining the current
-  formatting, except for the final two instructions of the inline asm
-  sequence, which the original commit missed.  Omit the original 64-bit
-  parts though.
-
-- Rename the original `do_div' macro to `__div64_32'.  Use the combined
-  `x' constraint referring to the MD accumulator as a whole, replacing
-  the original individual `h' and `l' constraints used for $hi and $lo
-  registers respectively, of which `h' has been obsoleted with GCC 4.4.
-  Update surrounding code accordingly.
-
-  We have since removed support for GCC versions before 4.9, so no need
-  for a special arrangement here; GCC has supported the `x' constraint
-  since forever anyway, or at least going back to 1991.
-
-- Rename the `__base' local variable in `__div64_32' to `__radix' to
-  avoid a conflict with a local variable in `do_div'.
-
-- Actually enable this code for 32-bit rather than 64-bit configurations
-  by qualifying it with BITS_PER_LONG being 32 instead of 64.  Include
-  <asm/bitsperlong.h> for this macro rather than <linux/types.h> as we
-  don't need anything else.
-
-- Finally include <asm-generic/div64.h> last rather than first.
-
-This has passed correctness verification with test_div64 and reduced the
-module's average execution time down to 1.0668s and 0.2629s from 2.1529s
-and 0.5647s respectively for an R3400 CPU @40MHz and a 5Kc CPU @160MHz.
-For a reference 64-bit `do_div' code where we have the DDIVU instruction
-available to do the whole calculation right away averages at 0.0660s for
-the latter CPU.
-
-Fixes: c21004cd5b4c ("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0.")
-Reported-by: Huacai Chen <chenhuacai@kernel.org>
-Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
-Cc: stable@vger.kernel.org # v2.6.30+
-Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- arch/mips/include/asm/div64.h |   57 ++++++++++++++++++++++++++++++------------
- 1 file changed, 41 insertions(+), 16 deletions(-)
-
---- a/arch/mips/include/asm/div64.h
-+++ b/arch/mips/include/asm/div64.h
-@@ -1,5 +1,5 @@
- /*
-- * Copyright (C) 2000, 2004  Maciej W. Rozycki
-+ * Copyright (C) 2000, 2004, 2021  Maciej W. Rozycki
-  * Copyright (C) 2003, 07 Ralf Baechle (ralf@linux-mips.org)
-  *
-  * This file is subject to the terms and conditions of the GNU General Public
-@@ -9,25 +9,18 @@
- #ifndef __ASM_DIV64_H
- #define __ASM_DIV64_H
--#include <asm-generic/div64.h>
--
--#if BITS_PER_LONG == 64
-+#include <asm/bitsperlong.h>
--#include <linux/types.h>
-+#if BITS_PER_LONG == 32
- /*
-  * No traps on overflows for any of these...
-  */
--#define __div64_32(n, base)                                           \
--({                                                                    \
-+#define do_div64_32(res, high, low, base) ({                          \
-       unsigned long __cf, __tmp, __tmp2, __i;                         \
-       unsigned long __quot32, __mod32;                                \
--      unsigned long __high, __low;                                    \
--      unsigned long long __n;                                         \
-                                                                       \
--      __high = *__n >> 32;                                            \
--      __low = __n;                                                    \
-       __asm__(                                                        \
-       "       .set    push                                    \n"     \
-       "       .set    noat                                    \n"     \
-@@ -51,18 +44,50 @@
-       "       subu    %0, %0, %z6                             \n"     \
-       "       addiu   %2, %2, 1                               \n"     \
-       "3:                                                     \n"     \
--      "       bnez    %4, 0b\n\t"                                     \
--      "        srl    %5, %1, 0x1f\n\t"                               \
-+      "       bnez    %4, 0b                                  \n"     \
-+      "        srl    %5, %1, 0x1f                            \n"     \
-       "       .set    pop"                                            \
-       : "=&r" (__mod32), "=&r" (__tmp),                               \
-         "=&r" (__quot32), "=&r" (__cf),                               \
-         "=&r" (__i), "=&r" (__tmp2)                                   \
--      : "Jr" (base), "0" (__high), "1" (__low));                      \
-+      : "Jr" (base), "0" (high), "1" (low));                          \
-                                                                       \
--      (__n) = __quot32;                                               \
-+      (res) = __quot32;                                               \
-       __mod32;                                                        \
- })
--#endif /* BITS_PER_LONG == 64 */
-+#define __div64_32(n, base) ({                                                \
-+      unsigned long __upper, __low, __high, __radix;                  \
-+      unsigned long long __modquot;                                   \
-+      unsigned long long __quot;                                      \
-+      unsigned long long __div;                                       \
-+      unsigned long __mod;                                            \
-+                                                                      \
-+      __div = (*n);                                                   \
-+      __radix = (base);                                               \
-+                                                                      \
-+      __high = __div >> 32;                                           \
-+      __low = __div;                                                  \
-+      __upper = __high;                                               \
-+                                                                      \
-+      if (__high) {                                                   \
-+              __asm__("divu   $0, %z1, %z2"                           \
-+              : "=x" (__modquot)                                      \
-+              : "Jr" (__high), "Jr" (__radix));                       \
-+              __upper = __modquot >> 32;                              \
-+              __high = __modquot;                                     \
-+      }                                                               \
-+                                                                      \
-+      __mod = do_div64_32(__low, __upper, __low, __radix);            \
-+                                                                      \
-+      __quot = __high;                                                \
-+      __quot = __quot << 32 | __low;                                  \
-+      (*n) = __quot;                                                  \
-+      __mod;                                                          \
-+})
-+
-+#endif /* BITS_PER_LONG == 32 */
-+
-+#include <asm-generic/div64.h>
- #endif /* __ASM_DIV64_H */
index 99f02074dc3c3ea565f03b2c0d1cfa5fffc25f27..ee13d6f205941c0447cc544915b89fcc3d38523b 100644 (file)
@@ -143,7 +143,6 @@ md-split-mddev_find.patch
 md-factor-out-a-mddev_find_locked-helper-from-mddev_find.patch
 md-md_open-returns-ebusy-when-entering-racing-area.patch
 md-fix-missing-unused-status-line-of-proc-mdstat.patch
-mips-reinstate-platform-__div64_32-handler.patch
 ipw2x00-potential-buffer-overflow-in-libipw_wx_set_encodeext.patch
 cfg80211-scan-drop-entry-from-hidden_list-on-overflow.patch
 drm-radeon-fix-copy-of-uninitialized-variable-back-to-userspace.patch
diff --git a/queue-4.4/mips-reinstate-platform-__div64_32-handler.patch b/queue-4.4/mips-reinstate-platform-__div64_32-handler.patch
deleted file mode 100644 (file)
index 3a0267d..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-From c49f71f60754acbff37505e1d16ca796bf8a8140 Mon Sep 17 00:00:00 2001
-From: "Maciej W. Rozycki" <macro@orcam.me.uk>
-Date: Tue, 20 Apr 2021 04:50:40 +0200
-Subject: MIPS: Reinstate platform `__div64_32' handler
-
-From: Maciej W. Rozycki <macro@orcam.me.uk>
-
-commit c49f71f60754acbff37505e1d16ca796bf8a8140 upstream.
-
-Our current MIPS platform `__div64_32' handler is inactive, because it
-is incorrectly only enabled for 64-bit configurations, for which generic
-`do_div' code does not call it anyway.
-
-The handler is not suitable for being called from there though as it
-only calculates 32 bits of the quotient under the assumption the 64-bit
-divident has been suitably reduced.  Code for such reduction used to be
-there, however it has been incorrectly removed with commit c21004cd5b4c
-("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0."), which should
-have only updated an obsoleted constraint for an inline asm involving
-$hi and $lo register outputs, while possibly wiring the original MIPS
-variant of the `do_div' macro as `__div64_32' handler for the generic
-`do_div' implementation
-
-Correct the handler as follows then:
-
-- Revert most of the commit referred, however retaining the current
-  formatting, except for the final two instructions of the inline asm
-  sequence, which the original commit missed.  Omit the original 64-bit
-  parts though.
-
-- Rename the original `do_div' macro to `__div64_32'.  Use the combined
-  `x' constraint referring to the MD accumulator as a whole, replacing
-  the original individual `h' and `l' constraints used for $hi and $lo
-  registers respectively, of which `h' has been obsoleted with GCC 4.4.
-  Update surrounding code accordingly.
-
-  We have since removed support for GCC versions before 4.9, so no need
-  for a special arrangement here; GCC has supported the `x' constraint
-  since forever anyway, or at least going back to 1991.
-
-- Rename the `__base' local variable in `__div64_32' to `__radix' to
-  avoid a conflict with a local variable in `do_div'.
-
-- Actually enable this code for 32-bit rather than 64-bit configurations
-  by qualifying it with BITS_PER_LONG being 32 instead of 64.  Include
-  <asm/bitsperlong.h> for this macro rather than <linux/types.h> as we
-  don't need anything else.
-
-- Finally include <asm-generic/div64.h> last rather than first.
-
-This has passed correctness verification with test_div64 and reduced the
-module's average execution time down to 1.0668s and 0.2629s from 2.1529s
-and 0.5647s respectively for an R3400 CPU @40MHz and a 5Kc CPU @160MHz.
-For a reference 64-bit `do_div' code where we have the DDIVU instruction
-available to do the whole calculation right away averages at 0.0660s for
-the latter CPU.
-
-Fixes: c21004cd5b4c ("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0.")
-Reported-by: Huacai Chen <chenhuacai@kernel.org>
-Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
-Cc: stable@vger.kernel.org # v2.6.30+
-Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- arch/mips/include/asm/div64.h |   57 ++++++++++++++++++++++++++++++------------
- 1 file changed, 41 insertions(+), 16 deletions(-)
-
---- a/arch/mips/include/asm/div64.h
-+++ b/arch/mips/include/asm/div64.h
-@@ -1,5 +1,5 @@
- /*
-- * Copyright (C) 2000, 2004  Maciej W. Rozycki
-+ * Copyright (C) 2000, 2004, 2021  Maciej W. Rozycki
-  * Copyright (C) 2003, 07 Ralf Baechle (ralf@linux-mips.org)
-  *
-  * This file is subject to the terms and conditions of the GNU General Public
-@@ -9,25 +9,18 @@
- #ifndef __ASM_DIV64_H
- #define __ASM_DIV64_H
--#include <asm-generic/div64.h>
--
--#if BITS_PER_LONG == 64
-+#include <asm/bitsperlong.h>
--#include <linux/types.h>
-+#if BITS_PER_LONG == 32
- /*
-  * No traps on overflows for any of these...
-  */
--#define __div64_32(n, base)                                           \
--({                                                                    \
-+#define do_div64_32(res, high, low, base) ({                          \
-       unsigned long __cf, __tmp, __tmp2, __i;                         \
-       unsigned long __quot32, __mod32;                                \
--      unsigned long __high, __low;                                    \
--      unsigned long long __n;                                         \
-                                                                       \
--      __high = *__n >> 32;                                            \
--      __low = __n;                                                    \
-       __asm__(                                                        \
-       "       .set    push                                    \n"     \
-       "       .set    noat                                    \n"     \
-@@ -51,18 +44,50 @@
-       "       subu    %0, %0, %z6                             \n"     \
-       "       addiu   %2, %2, 1                               \n"     \
-       "3:                                                     \n"     \
--      "       bnez    %4, 0b\n\t"                                     \
--      "        srl    %5, %1, 0x1f\n\t"                               \
-+      "       bnez    %4, 0b                                  \n"     \
-+      "        srl    %5, %1, 0x1f                            \n"     \
-       "       .set    pop"                                            \
-       : "=&r" (__mod32), "=&r" (__tmp),                               \
-         "=&r" (__quot32), "=&r" (__cf),                               \
-         "=&r" (__i), "=&r" (__tmp2)                                   \
--      : "Jr" (base), "0" (__high), "1" (__low));                      \
-+      : "Jr" (base), "0" (high), "1" (low));                          \
-                                                                       \
--      (__n) = __quot32;                                               \
-+      (res) = __quot32;                                               \
-       __mod32;                                                        \
- })
--#endif /* BITS_PER_LONG == 64 */
-+#define __div64_32(n, base) ({                                                \
-+      unsigned long __upper, __low, __high, __radix;                  \
-+      unsigned long long __modquot;                                   \
-+      unsigned long long __quot;                                      \
-+      unsigned long long __div;                                       \
-+      unsigned long __mod;                                            \
-+                                                                      \
-+      __div = (*n);                                                   \
-+      __radix = (base);                                               \
-+                                                                      \
-+      __high = __div >> 32;                                           \
-+      __low = __div;                                                  \
-+      __upper = __high;                                               \
-+                                                                      \
-+      if (__high) {                                                   \
-+              __asm__("divu   $0, %z1, %z2"                           \
-+              : "=x" (__modquot)                                      \
-+              : "Jr" (__high), "Jr" (__radix));                       \
-+              __upper = __modquot >> 32;                              \
-+              __high = __modquot;                                     \
-+      }                                                               \
-+                                                                      \
-+      __mod = do_div64_32(__low, __upper, __low, __radix);            \
-+                                                                      \
-+      __quot = __high;                                                \
-+      __quot = __quot << 32 | __low;                                  \
-+      (*n) = __quot;                                                  \
-+      __mod;                                                          \
-+})
-+
-+#endif /* BITS_PER_LONG == 32 */
-+
-+#include <asm-generic/div64.h>
- #endif /* __ASM_DIV64_H */
index 4153e876135a60352773a6c0955e37002a72251f..ea8c1b1ddf1c8ad1b53d1f257f58ee40056586f7 100644 (file)
@@ -64,7 +64,6 @@ tracing-map-all-pids-to-command-lines.patch
 tracing-restructure-trace_clock_global-to-never-block.patch
 md-factor-out-a-mddev_find_locked-helper-from-mddev_find.patch
 md-md_open-returns-ebusy-when-entering-racing-area.patch
-mips-reinstate-platform-__div64_32-handler.patch
 ipw2x00-potential-buffer-overflow-in-libipw_wx_set_encodeext.patch
 cfg80211-scan-drop-entry-from-hidden_list-on-overflow.patch
 drm-radeon-fix-copy-of-uninitialized-variable-back-to-userspace.patch
diff --git a/queue-4.9/mips-reinstate-platform-__div64_32-handler.patch b/queue-4.9/mips-reinstate-platform-__div64_32-handler.patch
deleted file mode 100644 (file)
index 3a0267d..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-From c49f71f60754acbff37505e1d16ca796bf8a8140 Mon Sep 17 00:00:00 2001
-From: "Maciej W. Rozycki" <macro@orcam.me.uk>
-Date: Tue, 20 Apr 2021 04:50:40 +0200
-Subject: MIPS: Reinstate platform `__div64_32' handler
-
-From: Maciej W. Rozycki <macro@orcam.me.uk>
-
-commit c49f71f60754acbff37505e1d16ca796bf8a8140 upstream.
-
-Our current MIPS platform `__div64_32' handler is inactive, because it
-is incorrectly only enabled for 64-bit configurations, for which generic
-`do_div' code does not call it anyway.
-
-The handler is not suitable for being called from there though as it
-only calculates 32 bits of the quotient under the assumption the 64-bit
-divident has been suitably reduced.  Code for such reduction used to be
-there, however it has been incorrectly removed with commit c21004cd5b4c
-("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0."), which should
-have only updated an obsoleted constraint for an inline asm involving
-$hi and $lo register outputs, while possibly wiring the original MIPS
-variant of the `do_div' macro as `__div64_32' handler for the generic
-`do_div' implementation
-
-Correct the handler as follows then:
-
-- Revert most of the commit referred, however retaining the current
-  formatting, except for the final two instructions of the inline asm
-  sequence, which the original commit missed.  Omit the original 64-bit
-  parts though.
-
-- Rename the original `do_div' macro to `__div64_32'.  Use the combined
-  `x' constraint referring to the MD accumulator as a whole, replacing
-  the original individual `h' and `l' constraints used for $hi and $lo
-  registers respectively, of which `h' has been obsoleted with GCC 4.4.
-  Update surrounding code accordingly.
-
-  We have since removed support for GCC versions before 4.9, so no need
-  for a special arrangement here; GCC has supported the `x' constraint
-  since forever anyway, or at least going back to 1991.
-
-- Rename the `__base' local variable in `__div64_32' to `__radix' to
-  avoid a conflict with a local variable in `do_div'.
-
-- Actually enable this code for 32-bit rather than 64-bit configurations
-  by qualifying it with BITS_PER_LONG being 32 instead of 64.  Include
-  <asm/bitsperlong.h> for this macro rather than <linux/types.h> as we
-  don't need anything else.
-
-- Finally include <asm-generic/div64.h> last rather than first.
-
-This has passed correctness verification with test_div64 and reduced the
-module's average execution time down to 1.0668s and 0.2629s from 2.1529s
-and 0.5647s respectively for an R3400 CPU @40MHz and a 5Kc CPU @160MHz.
-For a reference 64-bit `do_div' code where we have the DDIVU instruction
-available to do the whole calculation right away averages at 0.0660s for
-the latter CPU.
-
-Fixes: c21004cd5b4c ("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0.")
-Reported-by: Huacai Chen <chenhuacai@kernel.org>
-Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
-Cc: stable@vger.kernel.org # v2.6.30+
-Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- arch/mips/include/asm/div64.h |   57 ++++++++++++++++++++++++++++++------------
- 1 file changed, 41 insertions(+), 16 deletions(-)
-
---- a/arch/mips/include/asm/div64.h
-+++ b/arch/mips/include/asm/div64.h
-@@ -1,5 +1,5 @@
- /*
-- * Copyright (C) 2000, 2004  Maciej W. Rozycki
-+ * Copyright (C) 2000, 2004, 2021  Maciej W. Rozycki
-  * Copyright (C) 2003, 07 Ralf Baechle (ralf@linux-mips.org)
-  *
-  * This file is subject to the terms and conditions of the GNU General Public
-@@ -9,25 +9,18 @@
- #ifndef __ASM_DIV64_H
- #define __ASM_DIV64_H
--#include <asm-generic/div64.h>
--
--#if BITS_PER_LONG == 64
-+#include <asm/bitsperlong.h>
--#include <linux/types.h>
-+#if BITS_PER_LONG == 32
- /*
-  * No traps on overflows for any of these...
-  */
--#define __div64_32(n, base)                                           \
--({                                                                    \
-+#define do_div64_32(res, high, low, base) ({                          \
-       unsigned long __cf, __tmp, __tmp2, __i;                         \
-       unsigned long __quot32, __mod32;                                \
--      unsigned long __high, __low;                                    \
--      unsigned long long __n;                                         \
-                                                                       \
--      __high = *__n >> 32;                                            \
--      __low = __n;                                                    \
-       __asm__(                                                        \
-       "       .set    push                                    \n"     \
-       "       .set    noat                                    \n"     \
-@@ -51,18 +44,50 @@
-       "       subu    %0, %0, %z6                             \n"     \
-       "       addiu   %2, %2, 1                               \n"     \
-       "3:                                                     \n"     \
--      "       bnez    %4, 0b\n\t"                                     \
--      "        srl    %5, %1, 0x1f\n\t"                               \
-+      "       bnez    %4, 0b                                  \n"     \
-+      "        srl    %5, %1, 0x1f                            \n"     \
-       "       .set    pop"                                            \
-       : "=&r" (__mod32), "=&r" (__tmp),                               \
-         "=&r" (__quot32), "=&r" (__cf),                               \
-         "=&r" (__i), "=&r" (__tmp2)                                   \
--      : "Jr" (base), "0" (__high), "1" (__low));                      \
-+      : "Jr" (base), "0" (high), "1" (low));                          \
-                                                                       \
--      (__n) = __quot32;                                               \
-+      (res) = __quot32;                                               \
-       __mod32;                                                        \
- })
--#endif /* BITS_PER_LONG == 64 */
-+#define __div64_32(n, base) ({                                                \
-+      unsigned long __upper, __low, __high, __radix;                  \
-+      unsigned long long __modquot;                                   \
-+      unsigned long long __quot;                                      \
-+      unsigned long long __div;                                       \
-+      unsigned long __mod;                                            \
-+                                                                      \
-+      __div = (*n);                                                   \
-+      __radix = (base);                                               \
-+                                                                      \
-+      __high = __div >> 32;                                           \
-+      __low = __div;                                                  \
-+      __upper = __high;                                               \
-+                                                                      \
-+      if (__high) {                                                   \
-+              __asm__("divu   $0, %z1, %z2"                           \
-+              : "=x" (__modquot)                                      \
-+              : "Jr" (__high), "Jr" (__radix));                       \
-+              __upper = __modquot >> 32;                              \
-+              __high = __modquot;                                     \
-+      }                                                               \
-+                                                                      \
-+      __mod = do_div64_32(__low, __upper, __low, __radix);            \
-+                                                                      \
-+      __quot = __high;                                                \
-+      __quot = __quot << 32 | __low;                                  \
-+      (*n) = __quot;                                                  \
-+      __mod;                                                          \
-+})
-+
-+#endif /* BITS_PER_LONG == 32 */
-+
-+#include <asm-generic/div64.h>
- #endif /* __ASM_DIV64_H */
index 2c866258f539de30f775f6c866ec31b55489bbec..f8c13ab633ac4f9b30c69178992c1e56bfc23df9 100644 (file)
@@ -80,7 +80,6 @@ tracing-restructure-trace_clock_global-to-never-block.patch
 md-cluster-fix-use-after-free-issue-when-removing-rdev.patch
 md-factor-out-a-mddev_find_locked-helper-from-mddev_find.patch
 md-md_open-returns-ebusy-when-entering-racing-area.patch
-mips-reinstate-platform-__div64_32-handler.patch
 ipw2x00-potential-buffer-overflow-in-libipw_wx_set_encodeext.patch
 cfg80211-scan-drop-entry-from-hidden_list-on-overflow.patch
 drm-radeon-fix-copy-of-uninitialized-variable-back-to-userspace.patch
diff --git a/queue-5.10/mips-reinstate-platform-__div64_32-handler.patch b/queue-5.10/mips-reinstate-platform-__div64_32-handler.patch
deleted file mode 100644 (file)
index 3a0267d..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-From c49f71f60754acbff37505e1d16ca796bf8a8140 Mon Sep 17 00:00:00 2001
-From: "Maciej W. Rozycki" <macro@orcam.me.uk>
-Date: Tue, 20 Apr 2021 04:50:40 +0200
-Subject: MIPS: Reinstate platform `__div64_32' handler
-
-From: Maciej W. Rozycki <macro@orcam.me.uk>
-
-commit c49f71f60754acbff37505e1d16ca796bf8a8140 upstream.
-
-Our current MIPS platform `__div64_32' handler is inactive, because it
-is incorrectly only enabled for 64-bit configurations, for which generic
-`do_div' code does not call it anyway.
-
-The handler is not suitable for being called from there though as it
-only calculates 32 bits of the quotient under the assumption the 64-bit
-divident has been suitably reduced.  Code for such reduction used to be
-there, however it has been incorrectly removed with commit c21004cd5b4c
-("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0."), which should
-have only updated an obsoleted constraint for an inline asm involving
-$hi and $lo register outputs, while possibly wiring the original MIPS
-variant of the `do_div' macro as `__div64_32' handler for the generic
-`do_div' implementation
-
-Correct the handler as follows then:
-
-- Revert most of the commit referred, however retaining the current
-  formatting, except for the final two instructions of the inline asm
-  sequence, which the original commit missed.  Omit the original 64-bit
-  parts though.
-
-- Rename the original `do_div' macro to `__div64_32'.  Use the combined
-  `x' constraint referring to the MD accumulator as a whole, replacing
-  the original individual `h' and `l' constraints used for $hi and $lo
-  registers respectively, of which `h' has been obsoleted with GCC 4.4.
-  Update surrounding code accordingly.
-
-  We have since removed support for GCC versions before 4.9, so no need
-  for a special arrangement here; GCC has supported the `x' constraint
-  since forever anyway, or at least going back to 1991.
-
-- Rename the `__base' local variable in `__div64_32' to `__radix' to
-  avoid a conflict with a local variable in `do_div'.
-
-- Actually enable this code for 32-bit rather than 64-bit configurations
-  by qualifying it with BITS_PER_LONG being 32 instead of 64.  Include
-  <asm/bitsperlong.h> for this macro rather than <linux/types.h> as we
-  don't need anything else.
-
-- Finally include <asm-generic/div64.h> last rather than first.
-
-This has passed correctness verification with test_div64 and reduced the
-module's average execution time down to 1.0668s and 0.2629s from 2.1529s
-and 0.5647s respectively for an R3400 CPU @40MHz and a 5Kc CPU @160MHz.
-For a reference 64-bit `do_div' code where we have the DDIVU instruction
-available to do the whole calculation right away averages at 0.0660s for
-the latter CPU.
-
-Fixes: c21004cd5b4c ("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0.")
-Reported-by: Huacai Chen <chenhuacai@kernel.org>
-Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
-Cc: stable@vger.kernel.org # v2.6.30+
-Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- arch/mips/include/asm/div64.h |   57 ++++++++++++++++++++++++++++++------------
- 1 file changed, 41 insertions(+), 16 deletions(-)
-
---- a/arch/mips/include/asm/div64.h
-+++ b/arch/mips/include/asm/div64.h
-@@ -1,5 +1,5 @@
- /*
-- * Copyright (C) 2000, 2004  Maciej W. Rozycki
-+ * Copyright (C) 2000, 2004, 2021  Maciej W. Rozycki
-  * Copyright (C) 2003, 07 Ralf Baechle (ralf@linux-mips.org)
-  *
-  * This file is subject to the terms and conditions of the GNU General Public
-@@ -9,25 +9,18 @@
- #ifndef __ASM_DIV64_H
- #define __ASM_DIV64_H
--#include <asm-generic/div64.h>
--
--#if BITS_PER_LONG == 64
-+#include <asm/bitsperlong.h>
--#include <linux/types.h>
-+#if BITS_PER_LONG == 32
- /*
-  * No traps on overflows for any of these...
-  */
--#define __div64_32(n, base)                                           \
--({                                                                    \
-+#define do_div64_32(res, high, low, base) ({                          \
-       unsigned long __cf, __tmp, __tmp2, __i;                         \
-       unsigned long __quot32, __mod32;                                \
--      unsigned long __high, __low;                                    \
--      unsigned long long __n;                                         \
-                                                                       \
--      __high = *__n >> 32;                                            \
--      __low = __n;                                                    \
-       __asm__(                                                        \
-       "       .set    push                                    \n"     \
-       "       .set    noat                                    \n"     \
-@@ -51,18 +44,50 @@
-       "       subu    %0, %0, %z6                             \n"     \
-       "       addiu   %2, %2, 1                               \n"     \
-       "3:                                                     \n"     \
--      "       bnez    %4, 0b\n\t"                                     \
--      "        srl    %5, %1, 0x1f\n\t"                               \
-+      "       bnez    %4, 0b                                  \n"     \
-+      "        srl    %5, %1, 0x1f                            \n"     \
-       "       .set    pop"                                            \
-       : "=&r" (__mod32), "=&r" (__tmp),                               \
-         "=&r" (__quot32), "=&r" (__cf),                               \
-         "=&r" (__i), "=&r" (__tmp2)                                   \
--      : "Jr" (base), "0" (__high), "1" (__low));                      \
-+      : "Jr" (base), "0" (high), "1" (low));                          \
-                                                                       \
--      (__n) = __quot32;                                               \
-+      (res) = __quot32;                                               \
-       __mod32;                                                        \
- })
--#endif /* BITS_PER_LONG == 64 */
-+#define __div64_32(n, base) ({                                                \
-+      unsigned long __upper, __low, __high, __radix;                  \
-+      unsigned long long __modquot;                                   \
-+      unsigned long long __quot;                                      \
-+      unsigned long long __div;                                       \
-+      unsigned long __mod;                                            \
-+                                                                      \
-+      __div = (*n);                                                   \
-+      __radix = (base);                                               \
-+                                                                      \
-+      __high = __div >> 32;                                           \
-+      __low = __div;                                                  \
-+      __upper = __high;                                               \
-+                                                                      \
-+      if (__high) {                                                   \
-+              __asm__("divu   $0, %z1, %z2"                           \
-+              : "=x" (__modquot)                                      \
-+              : "Jr" (__high), "Jr" (__radix));                       \
-+              __upper = __modquot >> 32;                              \
-+              __high = __modquot;                                     \
-+      }                                                               \
-+                                                                      \
-+      __mod = do_div64_32(__low, __upper, __low, __radix);            \
-+                                                                      \
-+      __quot = __high;                                                \
-+      __quot = __quot << 32 | __low;                                  \
-+      (*n) = __quot;                                                  \
-+      __mod;                                                          \
-+})
-+
-+#endif /* BITS_PER_LONG == 32 */
-+
-+#include <asm-generic/div64.h>
- #endif /* __ASM_DIV64_H */
index d95b8ad5efb76729478c15ee8cd0e627b23ee274..e413b974ca52a35c81c383094e18bf3969b9cb31 100644 (file)
@@ -49,7 +49,6 @@ md-split-mddev_find.patch
 md-factor-out-a-mddev_find_locked-helper-from-mddev_find.patch
 md-md_open-returns-ebusy-when-entering-racing-area.patch
 md-fix-missing-unused-status-line-of-proc-mdstat.patch
-mips-reinstate-platform-__div64_32-handler.patch
 mt76-mt7615-use-ieee80211_free_txskb-in-mt7615_tx_token_put.patch
 ipw2x00-potential-buffer-overflow-in-libipw_wx_set_encodeext.patch
 cfg80211-scan-drop-entry-from-hidden_list-on-overflow.patch
diff --git a/queue-5.11/mips-reinstate-platform-__div64_32-handler.patch b/queue-5.11/mips-reinstate-platform-__div64_32-handler.patch
deleted file mode 100644 (file)
index 3a0267d..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-From c49f71f60754acbff37505e1d16ca796bf8a8140 Mon Sep 17 00:00:00 2001
-From: "Maciej W. Rozycki" <macro@orcam.me.uk>
-Date: Tue, 20 Apr 2021 04:50:40 +0200
-Subject: MIPS: Reinstate platform `__div64_32' handler
-
-From: Maciej W. Rozycki <macro@orcam.me.uk>
-
-commit c49f71f60754acbff37505e1d16ca796bf8a8140 upstream.
-
-Our current MIPS platform `__div64_32' handler is inactive, because it
-is incorrectly only enabled for 64-bit configurations, for which generic
-`do_div' code does not call it anyway.
-
-The handler is not suitable for being called from there though as it
-only calculates 32 bits of the quotient under the assumption the 64-bit
-divident has been suitably reduced.  Code for such reduction used to be
-there, however it has been incorrectly removed with commit c21004cd5b4c
-("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0."), which should
-have only updated an obsoleted constraint for an inline asm involving
-$hi and $lo register outputs, while possibly wiring the original MIPS
-variant of the `do_div' macro as `__div64_32' handler for the generic
-`do_div' implementation
-
-Correct the handler as follows then:
-
-- Revert most of the commit referred, however retaining the current
-  formatting, except for the final two instructions of the inline asm
-  sequence, which the original commit missed.  Omit the original 64-bit
-  parts though.
-
-- Rename the original `do_div' macro to `__div64_32'.  Use the combined
-  `x' constraint referring to the MD accumulator as a whole, replacing
-  the original individual `h' and `l' constraints used for $hi and $lo
-  registers respectively, of which `h' has been obsoleted with GCC 4.4.
-  Update surrounding code accordingly.
-
-  We have since removed support for GCC versions before 4.9, so no need
-  for a special arrangement here; GCC has supported the `x' constraint
-  since forever anyway, or at least going back to 1991.
-
-- Rename the `__base' local variable in `__div64_32' to `__radix' to
-  avoid a conflict with a local variable in `do_div'.
-
-- Actually enable this code for 32-bit rather than 64-bit configurations
-  by qualifying it with BITS_PER_LONG being 32 instead of 64.  Include
-  <asm/bitsperlong.h> for this macro rather than <linux/types.h> as we
-  don't need anything else.
-
-- Finally include <asm-generic/div64.h> last rather than first.
-
-This has passed correctness verification with test_div64 and reduced the
-module's average execution time down to 1.0668s and 0.2629s from 2.1529s
-and 0.5647s respectively for an R3400 CPU @40MHz and a 5Kc CPU @160MHz.
-For a reference 64-bit `do_div' code where we have the DDIVU instruction
-available to do the whole calculation right away averages at 0.0660s for
-the latter CPU.
-
-Fixes: c21004cd5b4c ("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0.")
-Reported-by: Huacai Chen <chenhuacai@kernel.org>
-Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
-Cc: stable@vger.kernel.org # v2.6.30+
-Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- arch/mips/include/asm/div64.h |   57 ++++++++++++++++++++++++++++++------------
- 1 file changed, 41 insertions(+), 16 deletions(-)
-
---- a/arch/mips/include/asm/div64.h
-+++ b/arch/mips/include/asm/div64.h
-@@ -1,5 +1,5 @@
- /*
-- * Copyright (C) 2000, 2004  Maciej W. Rozycki
-+ * Copyright (C) 2000, 2004, 2021  Maciej W. Rozycki
-  * Copyright (C) 2003, 07 Ralf Baechle (ralf@linux-mips.org)
-  *
-  * This file is subject to the terms and conditions of the GNU General Public
-@@ -9,25 +9,18 @@
- #ifndef __ASM_DIV64_H
- #define __ASM_DIV64_H
--#include <asm-generic/div64.h>
--
--#if BITS_PER_LONG == 64
-+#include <asm/bitsperlong.h>
--#include <linux/types.h>
-+#if BITS_PER_LONG == 32
- /*
-  * No traps on overflows for any of these...
-  */
--#define __div64_32(n, base)                                           \
--({                                                                    \
-+#define do_div64_32(res, high, low, base) ({                          \
-       unsigned long __cf, __tmp, __tmp2, __i;                         \
-       unsigned long __quot32, __mod32;                                \
--      unsigned long __high, __low;                                    \
--      unsigned long long __n;                                         \
-                                                                       \
--      __high = *__n >> 32;                                            \
--      __low = __n;                                                    \
-       __asm__(                                                        \
-       "       .set    push                                    \n"     \
-       "       .set    noat                                    \n"     \
-@@ -51,18 +44,50 @@
-       "       subu    %0, %0, %z6                             \n"     \
-       "       addiu   %2, %2, 1                               \n"     \
-       "3:                                                     \n"     \
--      "       bnez    %4, 0b\n\t"                                     \
--      "        srl    %5, %1, 0x1f\n\t"                               \
-+      "       bnez    %4, 0b                                  \n"     \
-+      "        srl    %5, %1, 0x1f                            \n"     \
-       "       .set    pop"                                            \
-       : "=&r" (__mod32), "=&r" (__tmp),                               \
-         "=&r" (__quot32), "=&r" (__cf),                               \
-         "=&r" (__i), "=&r" (__tmp2)                                   \
--      : "Jr" (base), "0" (__high), "1" (__low));                      \
-+      : "Jr" (base), "0" (high), "1" (low));                          \
-                                                                       \
--      (__n) = __quot32;                                               \
-+      (res) = __quot32;                                               \
-       __mod32;                                                        \
- })
--#endif /* BITS_PER_LONG == 64 */
-+#define __div64_32(n, base) ({                                                \
-+      unsigned long __upper, __low, __high, __radix;                  \
-+      unsigned long long __modquot;                                   \
-+      unsigned long long __quot;                                      \
-+      unsigned long long __div;                                       \
-+      unsigned long __mod;                                            \
-+                                                                      \
-+      __div = (*n);                                                   \
-+      __radix = (base);                                               \
-+                                                                      \
-+      __high = __div >> 32;                                           \
-+      __low = __div;                                                  \
-+      __upper = __high;                                               \
-+                                                                      \
-+      if (__high) {                                                   \
-+              __asm__("divu   $0, %z1, %z2"                           \
-+              : "=x" (__modquot)                                      \
-+              : "Jr" (__high), "Jr" (__radix));                       \
-+              __upper = __modquot >> 32;                              \
-+              __high = __modquot;                                     \
-+      }                                                               \
-+                                                                      \
-+      __mod = do_div64_32(__low, __upper, __low, __radix);            \
-+                                                                      \
-+      __quot = __high;                                                \
-+      __quot = __quot << 32 | __low;                                  \
-+      (*n) = __quot;                                                  \
-+      __mod;                                                          \
-+})
-+
-+#endif /* BITS_PER_LONG == 32 */
-+
-+#include <asm-generic/div64.h>
- #endif /* __ASM_DIV64_H */
index 1350bdffaebca1cf142959b724f8f860ebb62c21..e5535b7fe2655be13fc37a026e124dbd32a3f3ee 100644 (file)
@@ -51,7 +51,6 @@ md-split-mddev_find.patch
 md-factor-out-a-mddev_find_locked-helper-from-mddev_find.patch
 md-md_open-returns-ebusy-when-entering-racing-area.patch
 md-fix-missing-unused-status-line-of-proc-mdstat.patch
-mips-reinstate-platform-__div64_32-handler.patch
 mips-generic-update-node-names-to-avoid-unit-addresses.patch
 mt76-mt7615-use-ieee80211_free_txskb-in-mt7615_tx_token_put.patch
 ipw2x00-potential-buffer-overflow-in-libipw_wx_set_encodeext.patch
diff --git a/queue-5.12/mips-reinstate-platform-__div64_32-handler.patch b/queue-5.12/mips-reinstate-platform-__div64_32-handler.patch
deleted file mode 100644 (file)
index 3a0267d..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-From c49f71f60754acbff37505e1d16ca796bf8a8140 Mon Sep 17 00:00:00 2001
-From: "Maciej W. Rozycki" <macro@orcam.me.uk>
-Date: Tue, 20 Apr 2021 04:50:40 +0200
-Subject: MIPS: Reinstate platform `__div64_32' handler
-
-From: Maciej W. Rozycki <macro@orcam.me.uk>
-
-commit c49f71f60754acbff37505e1d16ca796bf8a8140 upstream.
-
-Our current MIPS platform `__div64_32' handler is inactive, because it
-is incorrectly only enabled for 64-bit configurations, for which generic
-`do_div' code does not call it anyway.
-
-The handler is not suitable for being called from there though as it
-only calculates 32 bits of the quotient under the assumption the 64-bit
-divident has been suitably reduced.  Code for such reduction used to be
-there, however it has been incorrectly removed with commit c21004cd5b4c
-("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0."), which should
-have only updated an obsoleted constraint for an inline asm involving
-$hi and $lo register outputs, while possibly wiring the original MIPS
-variant of the `do_div' macro as `__div64_32' handler for the generic
-`do_div' implementation
-
-Correct the handler as follows then:
-
-- Revert most of the commit referred, however retaining the current
-  formatting, except for the final two instructions of the inline asm
-  sequence, which the original commit missed.  Omit the original 64-bit
-  parts though.
-
-- Rename the original `do_div' macro to `__div64_32'.  Use the combined
-  `x' constraint referring to the MD accumulator as a whole, replacing
-  the original individual `h' and `l' constraints used for $hi and $lo
-  registers respectively, of which `h' has been obsoleted with GCC 4.4.
-  Update surrounding code accordingly.
-
-  We have since removed support for GCC versions before 4.9, so no need
-  for a special arrangement here; GCC has supported the `x' constraint
-  since forever anyway, or at least going back to 1991.
-
-- Rename the `__base' local variable in `__div64_32' to `__radix' to
-  avoid a conflict with a local variable in `do_div'.
-
-- Actually enable this code for 32-bit rather than 64-bit configurations
-  by qualifying it with BITS_PER_LONG being 32 instead of 64.  Include
-  <asm/bitsperlong.h> for this macro rather than <linux/types.h> as we
-  don't need anything else.
-
-- Finally include <asm-generic/div64.h> last rather than first.
-
-This has passed correctness verification with test_div64 and reduced the
-module's average execution time down to 1.0668s and 0.2629s from 2.1529s
-and 0.5647s respectively for an R3400 CPU @40MHz and a 5Kc CPU @160MHz.
-For a reference 64-bit `do_div' code where we have the DDIVU instruction
-available to do the whole calculation right away averages at 0.0660s for
-the latter CPU.
-
-Fixes: c21004cd5b4c ("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0.")
-Reported-by: Huacai Chen <chenhuacai@kernel.org>
-Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
-Cc: stable@vger.kernel.org # v2.6.30+
-Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- arch/mips/include/asm/div64.h |   57 ++++++++++++++++++++++++++++++------------
- 1 file changed, 41 insertions(+), 16 deletions(-)
-
---- a/arch/mips/include/asm/div64.h
-+++ b/arch/mips/include/asm/div64.h
-@@ -1,5 +1,5 @@
- /*
-- * Copyright (C) 2000, 2004  Maciej W. Rozycki
-+ * Copyright (C) 2000, 2004, 2021  Maciej W. Rozycki
-  * Copyright (C) 2003, 07 Ralf Baechle (ralf@linux-mips.org)
-  *
-  * This file is subject to the terms and conditions of the GNU General Public
-@@ -9,25 +9,18 @@
- #ifndef __ASM_DIV64_H
- #define __ASM_DIV64_H
--#include <asm-generic/div64.h>
--
--#if BITS_PER_LONG == 64
-+#include <asm/bitsperlong.h>
--#include <linux/types.h>
-+#if BITS_PER_LONG == 32
- /*
-  * No traps on overflows for any of these...
-  */
--#define __div64_32(n, base)                                           \
--({                                                                    \
-+#define do_div64_32(res, high, low, base) ({                          \
-       unsigned long __cf, __tmp, __tmp2, __i;                         \
-       unsigned long __quot32, __mod32;                                \
--      unsigned long __high, __low;                                    \
--      unsigned long long __n;                                         \
-                                                                       \
--      __high = *__n >> 32;                                            \
--      __low = __n;                                                    \
-       __asm__(                                                        \
-       "       .set    push                                    \n"     \
-       "       .set    noat                                    \n"     \
-@@ -51,18 +44,50 @@
-       "       subu    %0, %0, %z6                             \n"     \
-       "       addiu   %2, %2, 1                               \n"     \
-       "3:                                                     \n"     \
--      "       bnez    %4, 0b\n\t"                                     \
--      "        srl    %5, %1, 0x1f\n\t"                               \
-+      "       bnez    %4, 0b                                  \n"     \
-+      "        srl    %5, %1, 0x1f                            \n"     \
-       "       .set    pop"                                            \
-       : "=&r" (__mod32), "=&r" (__tmp),                               \
-         "=&r" (__quot32), "=&r" (__cf),                               \
-         "=&r" (__i), "=&r" (__tmp2)                                   \
--      : "Jr" (base), "0" (__high), "1" (__low));                      \
-+      : "Jr" (base), "0" (high), "1" (low));                          \
-                                                                       \
--      (__n) = __quot32;                                               \
-+      (res) = __quot32;                                               \
-       __mod32;                                                        \
- })
--#endif /* BITS_PER_LONG == 64 */
-+#define __div64_32(n, base) ({                                                \
-+      unsigned long __upper, __low, __high, __radix;                  \
-+      unsigned long long __modquot;                                   \
-+      unsigned long long __quot;                                      \
-+      unsigned long long __div;                                       \
-+      unsigned long __mod;                                            \
-+                                                                      \
-+      __div = (*n);                                                   \
-+      __radix = (base);                                               \
-+                                                                      \
-+      __high = __div >> 32;                                           \
-+      __low = __div;                                                  \
-+      __upper = __high;                                               \
-+                                                                      \
-+      if (__high) {                                                   \
-+              __asm__("divu   $0, %z1, %z2"                           \
-+              : "=x" (__modquot)                                      \
-+              : "Jr" (__high), "Jr" (__radix));                       \
-+              __upper = __modquot >> 32;                              \
-+              __high = __modquot;                                     \
-+      }                                                               \
-+                                                                      \
-+      __mod = do_div64_32(__low, __upper, __low, __radix);            \
-+                                                                      \
-+      __quot = __high;                                                \
-+      __quot = __quot << 32 | __low;                                  \
-+      (*n) = __quot;                                                  \
-+      __mod;                                                          \
-+})
-+
-+#endif /* BITS_PER_LONG == 32 */
-+
-+#include <asm-generic/div64.h>
- #endif /* __ASM_DIV64_H */
index f492721848736b8708489f3c566be0e69ddd5799..5043f4567cf658f59597c6f44a4eb9b9fe73e56a 100644 (file)
@@ -59,7 +59,6 @@ md-split-mddev_find.patch
 md-factor-out-a-mddev_find_locked-helper-from-mddev_find.patch
 md-md_open-returns-ebusy-when-entering-racing-area.patch
 md-fix-missing-unused-status-line-of-proc-mdstat.patch
-mips-reinstate-platform-__div64_32-handler.patch
 mips-generic-update-node-names-to-avoid-unit-addresses.patch
 mt76-mt7615-use-ieee80211_free_txskb-in-mt7615_tx_token_put.patch
 ipw2x00-potential-buffer-overflow-in-libipw_wx_set_encodeext.patch
diff --git a/queue-5.4/mips-reinstate-platform-__div64_32-handler.patch b/queue-5.4/mips-reinstate-platform-__div64_32-handler.patch
deleted file mode 100644 (file)
index 3a0267d..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-From c49f71f60754acbff37505e1d16ca796bf8a8140 Mon Sep 17 00:00:00 2001
-From: "Maciej W. Rozycki" <macro@orcam.me.uk>
-Date: Tue, 20 Apr 2021 04:50:40 +0200
-Subject: MIPS: Reinstate platform `__div64_32' handler
-
-From: Maciej W. Rozycki <macro@orcam.me.uk>
-
-commit c49f71f60754acbff37505e1d16ca796bf8a8140 upstream.
-
-Our current MIPS platform `__div64_32' handler is inactive, because it
-is incorrectly only enabled for 64-bit configurations, for which generic
-`do_div' code does not call it anyway.
-
-The handler is not suitable for being called from there though as it
-only calculates 32 bits of the quotient under the assumption the 64-bit
-divident has been suitably reduced.  Code for such reduction used to be
-there, however it has been incorrectly removed with commit c21004cd5b4c
-("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0."), which should
-have only updated an obsoleted constraint for an inline asm involving
-$hi and $lo register outputs, while possibly wiring the original MIPS
-variant of the `do_div' macro as `__div64_32' handler for the generic
-`do_div' implementation
-
-Correct the handler as follows then:
-
-- Revert most of the commit referred, however retaining the current
-  formatting, except for the final two instructions of the inline asm
-  sequence, which the original commit missed.  Omit the original 64-bit
-  parts though.
-
-- Rename the original `do_div' macro to `__div64_32'.  Use the combined
-  `x' constraint referring to the MD accumulator as a whole, replacing
-  the original individual `h' and `l' constraints used for $hi and $lo
-  registers respectively, of which `h' has been obsoleted with GCC 4.4.
-  Update surrounding code accordingly.
-
-  We have since removed support for GCC versions before 4.9, so no need
-  for a special arrangement here; GCC has supported the `x' constraint
-  since forever anyway, or at least going back to 1991.
-
-- Rename the `__base' local variable in `__div64_32' to `__radix' to
-  avoid a conflict with a local variable in `do_div'.
-
-- Actually enable this code for 32-bit rather than 64-bit configurations
-  by qualifying it with BITS_PER_LONG being 32 instead of 64.  Include
-  <asm/bitsperlong.h> for this macro rather than <linux/types.h> as we
-  don't need anything else.
-
-- Finally include <asm-generic/div64.h> last rather than first.
-
-This has passed correctness verification with test_div64 and reduced the
-module's average execution time down to 1.0668s and 0.2629s from 2.1529s
-and 0.5647s respectively for an R3400 CPU @40MHz and a 5Kc CPU @160MHz.
-For a reference 64-bit `do_div' code where we have the DDIVU instruction
-available to do the whole calculation right away averages at 0.0660s for
-the latter CPU.
-
-Fixes: c21004cd5b4c ("MIPS: Rewrite <asm/div64.h> to work with gcc 4.4.0.")
-Reported-by: Huacai Chen <chenhuacai@kernel.org>
-Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
-Cc: stable@vger.kernel.org # v2.6.30+
-Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- arch/mips/include/asm/div64.h |   57 ++++++++++++++++++++++++++++++------------
- 1 file changed, 41 insertions(+), 16 deletions(-)
-
---- a/arch/mips/include/asm/div64.h
-+++ b/arch/mips/include/asm/div64.h
-@@ -1,5 +1,5 @@
- /*
-- * Copyright (C) 2000, 2004  Maciej W. Rozycki
-+ * Copyright (C) 2000, 2004, 2021  Maciej W. Rozycki
-  * Copyright (C) 2003, 07 Ralf Baechle (ralf@linux-mips.org)
-  *
-  * This file is subject to the terms and conditions of the GNU General Public
-@@ -9,25 +9,18 @@
- #ifndef __ASM_DIV64_H
- #define __ASM_DIV64_H
--#include <asm-generic/div64.h>
--
--#if BITS_PER_LONG == 64
-+#include <asm/bitsperlong.h>
--#include <linux/types.h>
-+#if BITS_PER_LONG == 32
- /*
-  * No traps on overflows for any of these...
-  */
--#define __div64_32(n, base)                                           \
--({                                                                    \
-+#define do_div64_32(res, high, low, base) ({                          \
-       unsigned long __cf, __tmp, __tmp2, __i;                         \
-       unsigned long __quot32, __mod32;                                \
--      unsigned long __high, __low;                                    \
--      unsigned long long __n;                                         \
-                                                                       \
--      __high = *__n >> 32;                                            \
--      __low = __n;                                                    \
-       __asm__(                                                        \
-       "       .set    push                                    \n"     \
-       "       .set    noat                                    \n"     \
-@@ -51,18 +44,50 @@
-       "       subu    %0, %0, %z6                             \n"     \
-       "       addiu   %2, %2, 1                               \n"     \
-       "3:                                                     \n"     \
--      "       bnez    %4, 0b\n\t"                                     \
--      "        srl    %5, %1, 0x1f\n\t"                               \
-+      "       bnez    %4, 0b                                  \n"     \
-+      "        srl    %5, %1, 0x1f                            \n"     \
-       "       .set    pop"                                            \
-       : "=&r" (__mod32), "=&r" (__tmp),                               \
-         "=&r" (__quot32), "=&r" (__cf),                               \
-         "=&r" (__i), "=&r" (__tmp2)                                   \
--      : "Jr" (base), "0" (__high), "1" (__low));                      \
-+      : "Jr" (base), "0" (high), "1" (low));                          \
-                                                                       \
--      (__n) = __quot32;                                               \
-+      (res) = __quot32;                                               \
-       __mod32;                                                        \
- })
--#endif /* BITS_PER_LONG == 64 */
-+#define __div64_32(n, base) ({                                                \
-+      unsigned long __upper, __low, __high, __radix;                  \
-+      unsigned long long __modquot;                                   \
-+      unsigned long long __quot;                                      \
-+      unsigned long long __div;                                       \
-+      unsigned long __mod;                                            \
-+                                                                      \
-+      __div = (*n);                                                   \
-+      __radix = (base);                                               \
-+                                                                      \
-+      __high = __div >> 32;                                           \
-+      __low = __div;                                                  \
-+      __upper = __high;                                               \
-+                                                                      \
-+      if (__high) {                                                   \
-+              __asm__("divu   $0, %z1, %z2"                           \
-+              : "=x" (__modquot)                                      \
-+              : "Jr" (__high), "Jr" (__radix));                       \
-+              __upper = __modquot >> 32;                              \
-+              __high = __modquot;                                     \
-+      }                                                               \
-+                                                                      \
-+      __mod = do_div64_32(__low, __upper, __low, __radix);            \
-+                                                                      \
-+      __quot = __high;                                                \
-+      __quot = __quot << 32 | __low;                                  \
-+      (*n) = __quot;                                                  \
-+      __mod;                                                          \
-+})
-+
-+#endif /* BITS_PER_LONG == 32 */
-+
-+#include <asm-generic/div64.h>
- #endif /* __ASM_DIV64_H */
index a2c22b43acc3ed68077d82fc46b83d9715afbd30..8334463cae31881abd085e7fdd8c0e36dc97a803 100644 (file)
@@ -32,7 +32,6 @@ md-split-mddev_find.patch
 md-factor-out-a-mddev_find_locked-helper-from-mddev_find.patch
 md-md_open-returns-ebusy-when-entering-racing-area.patch
 md-fix-missing-unused-status-line-of-proc-mdstat.patch
-mips-reinstate-platform-__div64_32-handler.patch
 ipw2x00-potential-buffer-overflow-in-libipw_wx_set_encodeext.patch
 cfg80211-scan-drop-entry-from-hidden_list-on-overflow.patch
 rtw88-fix-array-overrun-in-rtw_get_tx_power_params.patch