1. 13 May, 2015 25 commits
  2. 11 May, 2015 14 commits
    • Ard Biesheuvel's avatar
      crypto: arm/aes - streamline AES-192 code path · 6499e8cf
      Ard Biesheuvel authored
      This trims off a couple of instructions of the total size of the
      core AES transform by reordering the final branch in the AES-192
      code path with the rounds that are performed regardless of whether
      the branch is taken or not. Other than the slight size reduction,
      this has no performance benefit.
      
      Fix up a comment regarding the prototype of this function while
      we're at it.
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      6499e8cf
    • Ard Biesheuvel's avatar
      crypto: arm/sha512 - accelerated SHA-512 using ARM generic ASM and NEON · c80ae7ca
      Ard Biesheuvel authored
      This replaces the SHA-512 NEON module with the faster and more
      versatile implementation from the OpenSSL project. It consists
      of both a NEON and a generic ASM version of the core SHA-512
      transform, where the NEON version reverts to the ASM version
      when invoked in non-process context.
      
      This patch is based on the OpenSSL upstream version b1a5d1c65208
      of sha512-armv4.pl, which can be found here:
      
        https://git.openssl.org/gitweb/?p=openssl.git;h=b1a5d1c65208
      
      Performance relative to the generic implementation (measured
      using tcrypt.ko mode=306 sec=1 running on a Cortex-A57 under
      KVM):
      
        input size	block size	asm	neon	old neon
      
        16		16		1.39	2.54	2.21
        64		16		1.32	2.33	2.09
        64		64		1.38	2.53	2.19
        256		16		1.31	2.28	2.06
        256		64		1.38	2.54	2.25
        256		256		1.40	2.77	2.39
        1024		16		1.29	2.22	2.01
        1024		256		1.40	2.82	2.45
        1024		1024		1.41	2.93	2.53
        2048		16		1.33	2.21	2.00
        2048		256		1.40	2.84	2.46
        2048		1024		1.41	2.96	2.55
        2048		2048		1.41	2.98	2.56
        4096		16		1.34	2.20	1.99
        4096		256		1.40	2.84	2.46
        4096		1024		1.41	2.97	2.56
        4096		4096		1.41	3.01	2.58
        8192		16		1.34	2.19	1.99
        8192		256		1.40	2.85	2.47
        8192		1024		1.41	2.98	2.56
        8192		4096		1.41	2.71	2.59
        8192		8192		1.51	3.51	2.69
      Acked-by: default avatarJussi Kivilinna <jussi.kivilinna@iki.fi>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      c80ae7ca
    • Allan, Bruce W's avatar
      551d7ed2
    • Dan Streetman's avatar
      crypto: nx - add hardware 842 crypto comp alg · ed70b479
      Dan Streetman authored
      Add crypto compression alg for 842 hardware compression and decompression,
      using the alg name "842" and driver_name "842-nx".
      
      This uses only the PowerPC coprocessor hardware for 842 compression.  It
      also uses the hardware for decompression, but if the hardware fails it will
      fall back to the 842 software decompression library, so that decompression
      never fails (for valid 842 compressed buffers).  A header must be used in
      most cases, due to the hardware's restrictions on the buffers being
      specifically aligned and sized.
      
      Due to the header this driver adds, compressed buffers it creates cannot be
      directly passed to the 842 software library for decompression.  However,
      compressed buffers created by the software 842 library can be passed to
      this driver for hardware 842 decompression (with the exception of buffers
      containing the "short data" template, as lib/842/842.h explains).
      Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      ed70b479
    • Dan Streetman's avatar
      crypto: nx - simplify pSeries nx842 driver · b8e04187
      Dan Streetman authored
      Simplify the pSeries NX-842 driver: do not expect incoming buffers to be
      exactly page-sized; do not break up input buffers to compress smaller
      blocks; do not use any internal headers in the compressed data blocks;
      remove the software decompression implementation; implement the pSeries
      nx842_constraints.
      
      This changes the pSeries NX-842 driver to perform constraints-based
      compression so that it only needs to compress one entire input block at a
      time.  This removes the need for it to split input data blocks into
      multiple compressed data sections in the output buffer, and removes the
      need for any extra header info in the compressed data; all that is moved
      (in a later patch) into the main crypto 842 driver.  Additionally, the
      842 software decompression implementation is no longer needed here, as
      the crypto 842 driver will use the generic software 842 decompression
      function as a fallback if any hardware 842 driver fails.
      Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      b8e04187
    • Dan Streetman's avatar
      crypto: nx - add PowerNV platform NX-842 driver · 99182a42
      Dan Streetman authored
      Add driver for NX-842 hardware on the PowerNV platform.
      
      This allows the use of the 842 compression hardware coprocessor on
      the PowerNV platform.
      Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      99182a42
    • Dan Streetman's avatar
      crypto: nx - add nx842 constraints · 959e6659
      Dan Streetman authored
      Add "constraints" for the NX-842 driver.  The constraints are used to
      indicate what the current NX-842 platform driver is capable of.  The
      constraints tell the NX-842 user what alignment, min and max length, and
      length multiple each provided buffers should conform to.  These are
      required because the 842 hardware requires buffers to meet specific
      constraints that vary based on platform - for example, the pSeries
      max length is much lower than the PowerNV max length.
      Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      959e6659
    • Dan Streetman's avatar
      crypto: nx - add NX-842 platform frontend driver · 7011a122
      Dan Streetman authored
      Add NX-842 frontend that allows using either the pSeries platform or
      PowerNV platform driver (to be added by later patch) for the NX-842
      hardware.  Update the MAINTAINERS file to include the new filenames.
      Update Kconfig files to clarify titles and descriptions, and correct
      dependencies.
      Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      7011a122
    • Dan Streetman's avatar
      crypto: nx - rename nx-842.c to nx-842-pseries.c · fdd05e4b
      Dan Streetman authored
      Move the entire NX-842 driver for the pSeries platform from the file
      nx-842.c to nx-842-pseries.c.  This is required by later patches that
      add NX-842 support for the PowerNV platform.
      
      This patch does not alter the content of the pSeries NX-842 driver at
      all, it only changes the filename.
      Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      fdd05e4b
    • Dan Streetman's avatar
      crypto: 842 - change 842 alg to use software · 2062c5b6
      Dan Streetman authored
      Change the crypto 842 compression alg to use the software 842 compression
      and decompression library.  Add the crypto driver_name as "842-generic".
      Remove the fallback to LZO compression.
      
      Previously, this crypto compression alg attemped 842 compression using
      PowerPC hardware, and fell back to LZO compression and decompression if
      the 842 PowerPC hardware was unavailable or failed.  This should not
      fall back to any other compression method, however; users of this crypto
      compression alg can fallback if desired, and transparent fallback tricks
      callers into thinking they are getting 842 compression when they actually
      get LZO compression - the failure of the 842 hardware should not be
      transparent to the caller.
      
      The crypto compression alg for a hardware device also should not be located
      in crypto/ so this is now a software-only implementation that uses the 842
      software compression/decompression library.
      Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      2062c5b6
    • Dan Streetman's avatar
      lib: add software 842 compression/decompression · 2da572c9
      Dan Streetman authored
      Add 842-format software compression and decompression functions.
      Update the MAINTAINERS 842 section to include the new files.
      
      The 842 compression function can compress any input data into the 842
      compression format.  The 842 decompression function can decompress any
      standard-format 842 compressed data - specifically, either a compressed
      data buffer created by the 842 software compression function, or a
      compressed data buffer created by the 842 hardware compressor (located
      in PowerPC coprocessors).
      
      The 842 compressed data format is explained in the header comments.
      
      This is used in a later patch to provide a full software 842 compression
      and decompression crypto interface.
      Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      2da572c9
    • Dan Streetman's avatar
      powerpc: Add ICSWX instruction · edc424f8
      Dan Streetman authored
      Add the asm ICSWX and ICSWEPX opcodes.  Add definitions for the
      Coprocessor Request structures needed to use the icswx calls to
      coprocessors.  Add icswx() function to perform the ICSWX asm
      using the provided Coprocessor Command Word value and
      Coprocessor Request Block structure.
      
      This is required for communication with the NX-842 coprocessor on
      a PowerNV system.
      Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      edc424f8
    • Dan Streetman's avatar
      powerpc: export of_get_ibm_chip_id function · b130e7c0
      Dan Streetman authored
      Export the of_get_ibm_chip_id() function.  This will be used by the
      PowerNV NX-842 driver.
      Signed-off-by: default avatarDan Streetman <ddstreet@ieee.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      b130e7c0
    • Ard Biesheuvel's avatar
      crypto: testmgr - add test cases for CRC32 · ebb3472f
      Ard Biesheuvel authored
      This adds a couple of test cases for CRC32 (not CRC32c) to
      ensure that the generic and arch specific implementations
      are in sync.
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: default avatarSteve Capper <steve.capper@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      ebb3472f
  3. 01 May, 2015 1 commit