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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 20 Sep 2023 13:23:08 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Roxana Nicolescu <roxana.nicolescu@...onical.com>
Cc:     davem@...emloft.net, tglx@...utronix.de, mingo@...hat.com,
        bp@...en8.de, dave.hansen@...ux.intel.com, hpa@...or.com,
        x86@...nel.org, linux-crypto@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: x86 - load optimized sha1/sha256 modules based
 on CPU features

On Fri, Sep 15, 2023 at 12:23:25PM +0200, Roxana Nicolescu wrote:
> x86 optimized crypto modules are built as modules rather than build-in and
> they are not loaded when the crypto API is initialized, resulting in the
> generic builtin module (sha1-generic) being used instead.
> 
> It was discovered when creating a sha1/sha256 checksum of a 2Gb file by
> using kcapi-tools because it would take significantly longer than creating
> a sha512 checksum of the same file. trace-cmd showed that for sha1/256 the
> generic module was used, whereas for sha512 the optimized module was used
> instead.
> 
> Add module aliases() for these x86 optimized crypto modules based on CPU
> feature bits so udev gets a chance to load them later in the boot
> process. This resulted in ~3x decrease in the real-time execution of
> kcapi-dsg.
> 
> Fix is inspired from commit
> aa031b8f702e ("crypto: x86/sha512 - load based on CPU features")
> where a similar fix was done for sha512.
> 
> Cc: stable@...r.kernel.org # 5.15+
> Suggested-by: Dimitri John Ledkov <dimitri.ledkov@...onical.com>
> Suggested-by: Julian Andres Klode <julian.klode@...onical.com>
> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@...onical.com>
> ---
>  arch/x86/crypto/sha1_ssse3_glue.c   | 12 ++++++++++++
>  arch/x86/crypto/sha256_ssse3_glue.c | 12 ++++++++++++
>  2 files changed, 24 insertions(+)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ