James Hogan
22d5e20c6a
lib/mpi: Fix umul_ppmm() for MIPS64r6
...
[ Upstream commit bbc25bee37 ]
Current MIPS64r6 toolchains aren't able to generate efficient
DMULU/DMUHU based code for the C implementation of umul_ppmm(), which
performs an unsigned 64 x 64 bit multiply and returns the upper and
lower 64-bit halves of the 128-bit result. Instead it widens the 64-bit
inputs to 128-bits and emits a __multi3 intrinsic call to perform a 128
x 128 multiply. This is both inefficient, and it results in a link error
since we don't include __multi3 in MIPS linux.
For example commit 90a53e4432 ("cfg80211: implement regdb signature
checking") merged in v4.15-rc1 recently broke the 64r6_defconfig and
64r6el_defconfig builds by indirectly selecting MPILIB. The same build
errors can be reproduced on older kernels by enabling e.g. CRYPTO_RSA:
lib/mpi/generic_mpih-mul1.o: In function `mpihelp_mul_1':
lib/mpi/generic_mpih-mul1.c:50: undefined reference to `__multi3'
lib/mpi/generic_mpih-mul2.o: In function `mpihelp_addmul_1':
lib/mpi/generic_mpih-mul2.c:49: undefined reference to `__multi3'
lib/mpi/generic_mpih-mul3.o: In function `mpihelp_submul_1':
lib/mpi/generic_mpih-mul3.c:49: undefined reference to `__multi3'
lib/mpi/mpih-div.o In function `mpihelp_divrem':
lib/mpi/mpih-div.c:205: undefined reference to `__multi3'
lib/mpi/mpih-div.c:142: undefined reference to `__multi3'
Therefore add an efficient MIPS64r6 implementation of umul_ppmm() using
inline assembly and the DMULU/DMUHU instructions, to prevent __multi3
calls being emitted.
Fixes: 7fd08ca58a ("MIPS: Add build support for the MIPS R6 ISA")
Signed-off-by: James Hogan <jhogan@kernel.org >
Cc: Ralf Baechle <ralf@linux-mips.org >
Cc: Herbert Xu <herbert@gondor.apana.org.au >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: linux-mips@linux-mips.org
Cc: linux-crypto@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
Signed-off-by: Sasha Levin <alexander.levin@verizon.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-03-03 10:24:29 +01:00
..
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-03 17:54:25 -07:00
2017-11-02 11:10:55 +01:00
2018-03-03 10:24:29 +01:00
2017-11-02 11:10:55 +01:00
2014-06-04 16:54:18 -07:00
2015-09-10 13:29:01 -07:00
2017-05-08 17:15:12 -07:00
2017-08-15 09:02:08 -07:00
2012-10-08 13:50:18 +10:30
2017-11-02 11:10:55 +01:00
2017-12-14 09:52:52 +01:00
2017-10-28 10:31:07 -07:00
2017-07-14 15:05:13 -07:00
locking/atomic: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
2016-06-16 10:48:32 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-08 18:26:49 -07:00
2014-12-22 16:43:06 +00:00
2017-07-10 16:32:35 -07:00
2015-11-23 09:44:58 +01:00
2017-11-02 11:10:55 +01:00
2013-06-19 17:54:06 +02:00
2017-11-02 11:10:55 +01:00
2016-07-03 00:57:23 -04:00
2017-11-02 11:10:55 +01:00
2016-03-13 23:55:13 -04:00
2014-04-03 16:21:12 -07:00
2017-11-02 11:10:55 +01:00
2017-09-08 18:26:49 -07:00
2017-11-02 11:10:55 +01:00
2011-10-29 21:20:22 +02:00
2015-05-27 15:22:15 +02:00
2017-11-02 11:10:55 +01:00
2017-06-09 11:52:07 +02:00
2014-05-16 14:26:52 -04:00
2011-06-03 15:01:06 -04:00
2017-02-24 17:46:57 -08:00
2017-11-02 11:10:55 +01:00
2017-02-24 17:46:57 -08:00
2015-05-26 15:26:43 +02:00
2015-05-30 22:42:24 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2013-06-26 12:10:56 +02:00
2017-08-14 16:51:01 +02:00
2017-11-02 11:10:55 +01:00
2015-09-10 13:29:01 -07:00
2017-11-02 11:10:55 +01:00
2017-02-24 17:46:57 -08:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-10-12 17:16:40 +01:00
2017-11-02 11:10:55 +01:00
2017-05-09 15:40:28 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-14 09:53:08 +01:00
2017-11-02 11:10:55 +01:00
2016-06-08 11:04:19 +02:00
2017-11-02 11:10:55 +01:00
2017-07-10 16:32:35 -07:00
2017-08-10 15:54:06 -07:00
2014-04-30 19:49:37 +01:00
2012-07-23 13:54:52 +01:00
2012-07-23 13:54:52 +01:00
2012-07-23 13:54:52 +01:00
2012-07-23 13:54:52 +01:00
2012-07-23 13:54:52 +01:00
2012-07-23 13:54:52 +01:00
2017-02-24 17:46:57 -08:00
2014-01-21 23:17:20 -08:00
2017-11-02 11:10:55 +01:00
2016-05-20 17:58:30 -07:00
2017-11-02 11:10:55 +01:00
2017-12-14 09:53:08 +01:00
2017-02-24 17:46:57 -08:00
2017-02-24 17:46:57 -08:00
2017-09-08 18:26:49 -07:00
2017-11-02 11:10:55 +01:00
2017-10-03 17:54:25 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-08 18:26:49 -07:00
2015-02-12 18:54:15 -08:00
2016-01-20 17:09:18 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 10:04:46 -07:00
2017-09-20 23:27:48 -04:00
2017-11-02 11:10:55 +01:00
2012-03-07 15:04:04 -05:00
2017-03-02 08:42:38 +01:00
2012-05-02 00:04:06 -07:00
2017-11-02 11:10:55 +01:00
2017-09-14 17:30:49 -07:00
2018-02-22 15:42:24 +01:00
2018-02-16 20:23:04 +01:00
2017-05-16 08:44:22 -03:00
2016-12-14 16:04:08 -08:00
2014-08-08 15:57:25 -07:00
2016-02-07 22:18:47 -08:00
2017-09-18 16:48:33 +02:00
2017-03-22 20:11:35 -06:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2015-03-31 09:45:50 -06:00
2017-06-08 17:36:03 +08:00
2017-02-24 17:46:56 -08:00
2017-11-02 11:10:55 +01:00
2015-11-06 17:50:42 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2015-11-25 09:22:02 -07:00
2017-11-02 11:10:55 +01:00
2012-07-30 17:25:22 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2015-12-03 11:49:23 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2013-04-09 14:13:05 -04:00
2017-11-02 11:10:55 +01:00
2012-12-14 10:32:52 +11:00
2018-02-25 11:08:01 +01:00
2017-11-02 11:10:55 +01:00
2017-02-03 16:35:42 -05:00
2016-12-06 10:17:03 +02:00
2015-09-08 14:35:59 -07:00
2017-11-02 11:10:55 +01:00
2017-03-02 08:42:34 +01:00
2013-11-13 12:09:11 +09:00
2017-03-22 19:18:43 -07:00
2017-03-02 08:42:27 +01:00
2012-07-30 17:25:22 -07:00
2017-01-23 09:17:12 +01:00
2017-09-08 18:26:49 -07:00
2017-11-02 11:10:55 +01:00
2017-10-03 17:54:26 -07:00
2017-11-02 11:10:55 +01:00
2017-09-08 18:26:48 -07:00
2017-09-08 18:26:48 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-19 15:18:33 -07:00
2017-04-14 14:06:52 -06:00
2017-06-15 14:30:14 +02:00
2017-11-02 11:10:55 +01:00
2016-04-15 16:53:14 -04:00
2015-08-24 14:28:01 -06:00
2017-11-02 11:10:55 +01:00
2017-02-22 16:41:30 -08:00
2017-01-09 13:58:57 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-11-11 08:12:37 -08:00
2015-02-12 18:54:16 -08:00
2017-09-13 18:53:16 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-02-22 15:42:15 +01:00
2017-11-02 11:10:55 +01:00
2017-09-13 18:53:15 -07:00
2018-01-31 14:03:49 +01:00
2017-09-08 18:26:49 -07:00
2018-02-03 17:39:24 +01:00
2016-09-01 17:52:01 -07:00
2016-01-20 17:09:18 -08:00
2017-03-31 17:13:30 -07:00
2017-09-08 18:26:50 -07:00
2017-05-08 17:15:10 -07:00
2014-01-23 16:36:57 -08:00
2017-02-26 11:03:38 -05:00
2016-03-15 16:55:16 -07:00
2017-07-25 12:35:23 -07:00
2017-01-09 13:58:57 -05:00
2017-05-08 17:15:10 -07:00
2015-08-03 11:51:12 +02:00
2016-02-09 10:27:29 +01:00
2017-07-12 16:26:00 -07:00
2017-05-01 09:36:30 +02:00
2017-07-21 09:38:30 +02:00
2015-09-10 13:29:01 -07:00
2016-02-03 08:28:43 -08:00
2014-10-14 02:18:14 +02:00
2017-01-20 08:03:42 +01:00
2017-10-22 03:14:07 +01:00
2017-10-22 03:14:07 +01:00
2018-02-16 20:23:09 +01:00
2018-02-16 20:23:09 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-06-05 16:59:05 +02:00
2017-07-07 10:37:54 -07:00
2017-11-02 11:10:55 +01:00
2017-08-15 09:02:07 -07:00