All of lore.kernel.org
 help / color / mirror / Atom feed
* REGRESSION: ChaCha fails to build in randconfig
@ 2020-01-17 16:02 Russell King - ARM Linux admin
  2020-01-17 16:22 ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux admin @ 2020-01-17 16:02 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: Arnd Bergmann, linux-arm-kernel

Ard,

Randconfig builds have found an issue with a commit in the last merge
window:

chacha-glue.c:(.text+0xc0): undefined reference to `chacha_4block_xor_neon'

This seems to be a result of this commit:

commit b36d8c09e710c71f6a9690b6586fea2d1c9e1e27
Author: Ard Biesheuvel <ardb@kernel.org>
Date:   Fri Nov 8 13:22:14 2019 +0100

    crypto: arm/chacha - remove dependency on generic ChaCha driver

CRYPTO_CHACHA20_NEON does not depend on KERNEL_MODE_NEON, yet the
makefile has:

obj-$(CONFIG_CRYPTO_CHACHA20_NEON) += chacha-neon.o
chacha-neon-y := chacha-scalar-core.o chacha-glue.o
chacha-neon-$(CONFIG_KERNEL_MODE_NEON) += chacha-neon-core.o

chacha-glue.c refers to chacha_4block_xor_neon in chacha_doneon(),
and I guess some compilers are not clever enough to eliminate that
code with KERNEL_MODE_NEON is disabled.

Arnd has a patch that adds a dependency to stop this being a problem,
but that is probably not what you want.  Please fix.

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: REGRESSION: ChaCha fails to build in randconfig
  2020-01-17 16:02 REGRESSION: ChaCha fails to build in randconfig Russell King - ARM Linux admin
@ 2020-01-17 16:22 ` Ard Biesheuvel
  2020-01-17 16:46   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2020-01-17 16:22 UTC (permalink / raw)
  To: Russell King - ARM Linux admin
  Cc: Arnd Bergmann, Ard Biesheuvel, linux-arm-kernel

On Fri, 17 Jan 2020 at 17:02, Russell King - ARM Linux admin
<linux@armlinux.org.uk> wrote:
>
> Ard,
>
> Randconfig builds have found an issue with a commit in the last merge
> window:
>
> chacha-glue.c:(.text+0xc0): undefined reference to `chacha_4block_xor_neon'
>
> This seems to be a result of this commit:
>
> commit b36d8c09e710c71f6a9690b6586fea2d1c9e1e27
> Author: Ard Biesheuvel <ardb@kernel.org>
> Date:   Fri Nov 8 13:22:14 2019 +0100
>
>     crypto: arm/chacha - remove dependency on generic ChaCha driver
>
> CRYPTO_CHACHA20_NEON does not depend on KERNEL_MODE_NEON, yet the
> makefile has:
>
> obj-$(CONFIG_CRYPTO_CHACHA20_NEON) += chacha-neon.o
> chacha-neon-y := chacha-scalar-core.o chacha-glue.o
> chacha-neon-$(CONFIG_KERNEL_MODE_NEON) += chacha-neon-core.o
>
> chacha-glue.c refers to chacha_4block_xor_neon in chacha_doneon(),
> and I guess some compilers are not clever enough to eliminate that
> code with KERNEL_MODE_NEON is disabled.
>
> Arnd has a patch that adds a dependency to stop this being a problem,
> but that is probably not what you want.  Please fix.
>

Thanks for the head's up

I'll post something along the lines of the below, that should convince
the compiler that chacha_4block_xor_neon() is never called when
CONFIG_KERNEL_MODE_NEON is not enabled.



--- a/arch/arm/crypto/chacha-glue.c
+++ b/arch/arm/crypto/chacha-glue.c
@@ -115,7 +115,7 @@ static int chacha_stream_xor(struct skcipher_request *req,
                if (nbytes < walk.total)
                        nbytes = round_down(nbytes, walk.stride);

-               if (!neon) {
+               if (!IS_ENABLED(CONFIG_KERNEL_MODE_NEON) || !neon) {
                        chacha_doarm(walk.dst.virt.addr, walk.src.virt.addr,
                                     nbytes, state, ctx->nrounds);
                        state[12] += DIV_ROUND_UP(nbytes, CHACHA_BLOCK_SIZE);
@@ -159,7 +159,7 @@ static int do_xchacha(struct skcipher_request
*req, bool neon)

        chacha_init_generic(state, ctx->key, req->iv);

-       if (!neon) {
+       if (!IS_ENABLED(CONFIG_KERNEL_MODE_NEON) || !neon) {
                hchacha_block_arm(state, subctx.key, ctx->nrounds);
        } else {
                kernel_neon_begin();

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: REGRESSION: ChaCha fails to build in randconfig
  2020-01-17 16:22 ` Ard Biesheuvel
@ 2020-01-17 16:46   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2020-01-17 16:46 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Russell King - ARM Linux admin, linux-arm-kernel, Ard Biesheuvel

On Fri, Jan 17, 2020 at 5:22 PM Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
>
> On Fri, 17 Jan 2020 at 17:02, Russell King - ARM Linux admin
> <linux@armlinux.org.uk> wrote:
> >
> > Ard,
> >
> > Randconfig builds have found an issue with a commit in the last merge
> > window:
> >
> > chacha-glue.c:(.text+0xc0): undefined reference to `chacha_4block_xor_neon'
> >
> > This seems to be a result of this commit:
> >
> > commit b36d8c09e710c71f6a9690b6586fea2d1c9e1e27
> > Author: Ard Biesheuvel <ardb@kernel.org>
> > Date:   Fri Nov 8 13:22:14 2019 +0100
> >
> >     crypto: arm/chacha - remove dependency on generic ChaCha driver
> >
> > CRYPTO_CHACHA20_NEON does not depend on KERNEL_MODE_NEON, yet the
> > makefile has:
> >
> > obj-$(CONFIG_CRYPTO_CHACHA20_NEON) += chacha-neon.o
> > chacha-neon-y := chacha-scalar-core.o chacha-glue.o
> > chacha-neon-$(CONFIG_KERNEL_MODE_NEON) += chacha-neon-core.o
> >
> > chacha-glue.c refers to chacha_4block_xor_neon in chacha_doneon(),
> > and I guess some compilers are not clever enough to eliminate that
> > code with KERNEL_MODE_NEON is disabled.
> >
> > Arnd has a patch that adds a dependency to stop this being a problem,
> > but that is probably not what you want.  Please fix.
> >
>
> Thanks for the head's up
>
> I'll post something along the lines of the below, that should convince
> the compiler that chacha_4block_xor_neon() is never called when
> CONFIG_KERNEL_MODE_NEON is not enabled.
>

I also see this related warning on linux-next:

    WARNING: unmet direct dependencies detected for CRYPTO_LIB_CHACHA20POLY1305
      Depends on [m]: CRYPTO [=y] && (CRYPTO_ARCH_HAVE_LIB_CHACHA [=m]
|| !CRYPTO_ARCH_HAVE_LIB_CHACHA [=m]) &&
(CRYPTO_ARCH_HAVE_LIB_POLY1305 [=y] || !CRYPTO_ARCH_HAVE_LIB_POLY1305
[=y])
      Selected by [y]:
      - WIREGUARD [=y] && NETDEVICES [=y] && NET_CORE [=y] && NET [=y]
&& INET [=y] && (IPV6 [=y] || !IPV6 [=y])

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-17 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 16:02 REGRESSION: ChaCha fails to build in randconfig Russell King - ARM Linux admin
2020-01-17 16:22 ` Ard Biesheuvel
2020-01-17 16:46   ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.