lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKv+Gu8P3U6_u7FdRFSdDL9jdKaJQuqHbrQ-7Qu900f8R1voZw@mail.gmail.com>
Date:   Fri, 27 Jan 2017 10:43:16 +0000
From:   Ard Biesheuvel <ard.biesheuvel@...aro.org>
To:     Matthias Brugger <mbrugger@...e.com>
Cc:     Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will.deacon@....com>,
        Yazen Ghannam <yazen.ghannam@...aro.org>,
        Alexander Graf <agraf@...e.de>,
        "linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] crypto: arm64/crc32 - detect crc32 support in assembler

Hi Mathias,

On 27 January 2017 at 10:40, Matthias Brugger <mbrugger@...e.com> wrote:
> Older compilers may not be able to detect the crc32 extended cpu type.

What do you mean 'detect'? Could you describe the failure in more detail please?

> Anyway only inline assembler code is used, which gets passed to the
> assembler. This patch moves the crc detection to the assembler.
>
> Suggested-by: Alexander Graf <agraf@...e.de>
> Signed-off-by: Matthias Brugger <mbrugger@...e.com>
> ---
>  arch/arm64/crypto/Makefile      | 2 --
>  arch/arm64/crypto/crc32-arm64.c | 3 +++
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/crypto/Makefile b/arch/arm64/crypto/Makefile
> index aa8888d7b744..0d779dac75cd 100644
> --- a/arch/arm64/crypto/Makefile
> +++ b/arch/arm64/crypto/Makefile
> @@ -48,8 +48,6 @@ CFLAGS_aes-glue-ce.o  := -DUSE_V8_CRYPTO_EXTENSIONS
>
>  obj-$(CONFIG_CRYPTO_CRC32_ARM64) += crc32-arm64.o
>
> -CFLAGS_crc32-arm64.o   := -mcpu=generic+crc
> -
>  $(obj)/aes-glue-%.o: $(src)/aes-glue.c FORCE
>         $(call if_changed_rule,cc_o_c)
>
> diff --git a/arch/arm64/crypto/crc32-arm64.c b/arch/arm64/crypto/crc32-arm64.c
> index 6a37c3c6b11d..10f5dd075323 100644
> --- a/arch/arm64/crypto/crc32-arm64.c
> +++ b/arch/arm64/crypto/crc32-arm64.c
> @@ -29,6 +29,9 @@ MODULE_AUTHOR("Yazen Ghannam <yazen.ghannam@...aro.org>");
>  MODULE_DESCRIPTION("CRC32 and CRC32C using optional ARMv8 instructions");
>  MODULE_LICENSE("GPL v2");
>
> +/* Request crc extension capabilities from the assembler */
> +asm(".arch_extension crc");
> +

Will should confirm, but I think this is a recent feature in GAS for
AArch64, so this may break older toolchains as well.

>  #define CRC32X(crc, value) __asm__("crc32x %w[c], %w[c], %x[v]":[c]"+r"(crc):[v]"r"(value))
>  #define CRC32W(crc, value) __asm__("crc32w %w[c], %w[c], %w[v]":[c]"+r"(crc):[v]"r"(value))
>  #define CRC32H(crc, value) __asm__("crc32h %w[c], %w[c], %w[v]":[c]"+r"(crc):[v]"r"(value))
> --
> 2.11.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ