diff mbox series

kernel: no chacha-mips.ko on mips32 r1 targets

Message ID 20210226223524.2604024-1-ilya.lipnitskiy@gmail.com
State Accepted
Delegated to: David Bauer
Headers show
Series kernel: no chacha-mips.ko on mips32 r1 targets | expand

Commit Message

Ilya Lipnitskiy Feb. 26, 2021, 10:35 p.m. UTC
CHACHA_MIPS depends on CPU_MIPS32_R2. Therefore,
kmod-crypto-lib-chacha20 should not contain chacha-mips.ko on MIPS32 R1
targets. Enforce that in the target-specific definition.

Fixes bcm47xx, bcm63xx, lantiq/ase, ath25 builds.

Fixes: 06351f1 ("kernel: migrate wireguard into the kernel tree")
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
---
 package/kernel/linux/modules/crypto.mk | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Jason A. Donenfeld Feb. 26, 2021, 11:06 p.m. UTC | #1
On Fri, Feb 26, 2021 at 11:35 PM Ilya Lipnitskiy
<ilya.lipnitskiy@gmail.com> wrote:
>
> CHACHA_MIPS depends on CPU_MIPS32_R2. Therefore,
> kmod-crypto-lib-chacha20 should not contain chacha-mips.ko on MIPS32 R1
> targets. Enforce that in the target-specific definition.
>
> Fixes bcm47xx, bcm63xx, lantiq/ase, ath25 builds.
>
> Fixes: 06351f1 ("kernel: migrate wireguard into the kernel tree")
> Cc: Jason A. Donenfeld <Jason@zx2c4.com>
> Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
> ---
>  package/kernel/linux/modules/crypto.mk | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk
> index a64b91a8fe..cbaa8d3ce5 100644
> --- a/package/kernel/linux/modules/crypto.mk
> +++ b/package/kernel/linux/modules/crypto.mk
> @@ -485,12 +485,15 @@ define KernelPackage/crypto-lib-chacha20/aarch64
>    FILES+=$(LINUX_DIR)/arch/arm64/crypto/chacha-neon.ko
>  endef
>
> -define KernelPackage/crypto-lib-chacha20/mips
> +define KernelPackage/crypto-lib-chacha20/mips32r2
>    KCONFIG+=CONFIG_CRYPTO_CHACHA_MIPS
>    FILES:=$(LINUX_DIR)/arch/mips/crypto/chacha-mips.ko
>  endef
>
> -KernelPackage/crypto-lib-chacha20/mipsel=$(KernelPackage/crypto-lib-chacha20/mips)
> +ifeq ($(CONFIG_CPU_MIPS32_R2),y)
> +  KernelPackage/crypto-lib-chacha20/$(ARCH)=\
> +         $(KernelPackage/crypto-lib-chacha20/mips32r2)
> +endif
>
>  ifdef KernelPackage/crypto-lib-chacha20/$(ARCH)
>    KernelPackage/crypto-lib-chacha20/$(CRYPTO_TARGET)=\
> --
> 2.30.1
>

Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>

Nice catch. Rene and I did this implementation for a little tplink
mips32r2 router I found on amazon.
diff mbox series

Patch

diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk
index a64b91a8fe..cbaa8d3ce5 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -485,12 +485,15 @@  define KernelPackage/crypto-lib-chacha20/aarch64
   FILES+=$(LINUX_DIR)/arch/arm64/crypto/chacha-neon.ko
 endef
 
-define KernelPackage/crypto-lib-chacha20/mips
+define KernelPackage/crypto-lib-chacha20/mips32r2
   KCONFIG+=CONFIG_CRYPTO_CHACHA_MIPS
   FILES:=$(LINUX_DIR)/arch/mips/crypto/chacha-mips.ko
 endef
 
-KernelPackage/crypto-lib-chacha20/mipsel=$(KernelPackage/crypto-lib-chacha20/mips)
+ifeq ($(CONFIG_CPU_MIPS32_R2),y)
+  KernelPackage/crypto-lib-chacha20/$(ARCH)=\
+	  $(KernelPackage/crypto-lib-chacha20/mips32r2)
+endif
 
 ifdef KernelPackage/crypto-lib-chacha20/$(ARCH)
   KernelPackage/crypto-lib-chacha20/$(CRYPTO_TARGET)=\