linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	"open list:HARDWARE RANDOM NUMBER GENERATOR CORE" 
	<linux-crypto@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] linux-next 20190731 - aegis128-core.c fails to build
Date: Thu, 01 Aug 2019 01:46:59 -0400	[thread overview]
Message-ID: <32521.1564638419@turing-police> (raw)
In-Reply-To: <CAKv+Gu8EF3R05hLWHh7mgbgkUyzBwELctdVvSFMq+6Crw6Tf4A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1374 bytes --]

On Thu, 01 Aug 2019 08:01:54 +0300, Ard Biesheuvel said:

> > ERROR: "crypto_aegis128_decrypt_chunk_simd" [crypto/aegis128.ko] undefined!
> > ERROR: "crypto_aegis128_update_simd" [crypto/aegis128.ko] undefined!
> > ERROR: "crypto_aegis128_encrypt_chunk_simd" [crypto/aegis128.ko] undefined!
> > make[1]: *** [scripts/Makefile.modpost:105: modules-modpost] Error 1
> > make: *** [Makefile:1299: modules] Error 2

> Which compiler version are you using? All references to the
> crypt_aegis128_xx_simd() routines should disappear if
> CONFIG_CRYPTO_AEGIS128_SIMD is not set (in which case have_simd will
> always be false and so the compiler should optimize away those calls).

gcc 9.1.1 obviously doesn't think it can be optimized away. Apparently, it's
not smart enough to realize that nothing sets have_simd in any of the functions
and therefor it's guaranteed to be zero, and  it can do dead code optimization
based on that.

Now, if we had something like:

#ifdef CONFIG_CRYPTO_AEGIS_128_SIMD
static bool have_simd;
#else
#define have_simd (0)
#endif

then that should be enough to tell the compiler it can optimize it away, except
that then runs into problems here:

        if (IS_ENABLED(CONFIG_CRYPTO_AEGIS128_SIMD))
                have_simd = crypto_aegis128_have_simd();

because it will whine about the lack of an lvalue before it optimizes the assignment away...

[-- Attachment #2: Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2019-08-01  5:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01  4:51 [PATCH] linux-next 20190731 - aegis128-core.c fails to build Valdis Klētnieks
2019-08-01  5:01 ` Ard Biesheuvel
2019-08-01  5:46   ` Valdis Klētnieks [this message]
2019-08-01  6:04     ` Ard Biesheuvel
2019-08-01  6:08       ` Valdis Klētnieks
2019-08-01 20:17         ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32521.1564638419@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).