1. 25 Oct, 2019 10 commits
    • YueHaibing's avatar
      hwrng: bcm2835 - use devm_platform_ioremap_resource() to simplify code · 3e46bd34
      YueHaibing authored
      Use devm_platform_ioremap_resource() to simplify the code a bit.
      This is detected by coccinelle.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      3e46bd34
    • YueHaibing's avatar
      hwrng: atmel - use devm_platform_ioremap_resource() to simplify code · bc49534d
      YueHaibing authored
      Use devm_platform_ioremap_resource() to simplify the code a bit.
      This is detected by coccinelle.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Acked-by: default avatarLudovic Desroches <ludovic.desroches@microchip.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      bc49534d
    • Ben Dooks's avatar
      hwrng: ka-sa - fix __iomem on registers · d1569349
      Ben Dooks authored
      Add __ioemm attribute to reg_rng to fix the following
      sparse warnings:
      
      drivers/char/hw_random/ks-sa-rng.c:102:9: warning: incorrect type in argument 2 (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:102:9:    expected void volatile [noderef] <asn:2> *addr
      drivers/char/hw_random/ks-sa-rng.c:102:9:    got unsigned int *
      drivers/char/hw_random/ks-sa-rng.c:104:9: warning: incorrect type in argument 2 (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:104:9:    expected void volatile [noderef] <asn:2> *addr
      drivers/char/hw_random/ks-sa-rng.c:104:9:    got unsigned int *
      drivers/char/hw_random/ks-sa-rng.c:113:9: warning: incorrect type in argument 2 (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:113:9:    expected void volatile [noderef] <asn:2> *addr
      drivers/char/hw_random/ks-sa-rng.c:113:9:    got unsigned int *
      drivers/char/hw_random/ks-sa-rng.c:116:9: warning: incorrect type in argument 2 (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:116:9:    expected void volatile [noderef] <asn:2> *addr
      drivers/char/hw_random/ks-sa-rng.c:116:9:    got unsigned int *
      drivers/char/hw_random/ks-sa-rng.c:119:17: warning: incorrect type in argument 1 (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:119:17:    expected void const volatile [noderef] <asn:2> *addr
      drivers/char/hw_random/ks-sa-rng.c:119:17:    got unsigned int *
      drivers/char/hw_random/ks-sa-rng.c:121:9: warning: incorrect type in argument 2 (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:121:9:    expected void volatile [noderef] <asn:2> *addr
      drivers/char/hw_random/ks-sa-rng.c:121:9:    got unsigned int *
      drivers/char/hw_random/ks-sa-rng.c:132:9: warning: incorrect type in argument 2 (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:132:9:    expected void volatile [noderef] <asn:2> *addr
      drivers/char/hw_random/ks-sa-rng.c:132:9:    got unsigned int *
      drivers/char/hw_random/ks-sa-rng.c:143:19: warning: incorrect type in argument 1 (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:143:19:    expected void const volatile [noderef] <asn:2> *addr
      drivers/char/hw_random/ks-sa-rng.c:143:19:    got unsigned int *
      drivers/char/hw_random/ks-sa-rng.c:144:19: warning: incorrect type in argument 1 (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:144:19:    expected void const volatile [noderef] <asn:2> *addr
      drivers/char/hw_random/ks-sa-rng.c:144:19:    got unsigned int *
      drivers/char/hw_random/ks-sa-rng.c:146:9: warning: incorrect type in argument 2 (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:146:9:    expected void volatile [noderef] <asn:2> *addr
      drivers/char/hw_random/ks-sa-rng.c:146:9:    got unsigned int *
      drivers/char/hw_random/ks-sa-rng.c:160:25: warning: incorrect type in argument 1 (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:160:25:    expected void const volatile [noderef] <asn:2> *addr
      drivers/char/hw_random/ks-sa-rng.c:160:25:    got unsigned int *
      drivers/char/hw_random/ks-sa-rng.c:194:28: warning: incorrect type in assignment (different address spaces)
      drivers/char/hw_random/ks-sa-rng.c:194:28:    expected struct trng_regs *reg_rng
      drivers/char/hw_random/ks-sa-rng.c:194:28:    got void [noderef] <asn:2> *
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      d1569349
    • Ard Biesheuvel's avatar
      crypto: powerpc/spe-xts - implement support for ciphertext stealing · d0be0720
      Ard Biesheuvel authored
      Add the logic to deal with input sizes that are not a round multiple
      of the AES block size, as described by the XTS spec. This brings the
      SPE implementation in line with other kernel drivers that have been
      updated recently to take this into account.
      
      Cc: Eric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      d0be0720
    • Eric Biggers's avatar
      crypto: powerpc - convert SPE AES algorithms to skcipher API · 7f725f41
      Eric Biggers authored
      Convert the glue code for the PowerPC SPE implementations of AES-ECB,
      AES-CBC, AES-CTR, and AES-XTS from the deprecated "blkcipher" API to the
      "skcipher" API.  This is needed in order for the blkcipher API to be
      removed.
      
      Tested with:
      
      	export ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu-
      	make mpc85xx_defconfig
      	cat >> .config << EOF
      	# CONFIG_MODULES is not set
      	# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
      	CONFIG_DEBUG_KERNEL=y
      	CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y
      	CONFIG_CRYPTO_AES=y
      	CONFIG_CRYPTO_CBC=y
      	CONFIG_CRYPTO_CTR=y
      	CONFIG_CRYPTO_ECB=y
      	CONFIG_CRYPTO_XTS=y
      	CONFIG_CRYPTO_AES_PPC_SPE=y
      	EOF
      	make olddefconfig
      	make -j32
      	qemu-system-ppc -M mpc8544ds -cpu e500 -nographic \
      		-kernel arch/powerpc/boot/zImage \
      		-append cryptomgr.fuzz_iterations=1000
      
      Note that xts-ppc-spe still fails the comparison tests due to the lack
      of ciphertext stealing support.  This is not addressed by this patch.
      
      This patch also cleans up the code by making ->encrypt() and ->decrypt()
      call a common function for each of ECB, CBC, and XTS, and by using a
      clearer way to compute the length to process at each step.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      7f725f41
    • Eric Biggers's avatar
      crypto: powerpc - don't set ivsize for AES-ECB · 8255e65d
      Eric Biggers authored
      Set the ivsize for the "ecb-ppc-spe" algorithm to 0, since ECB mode
      doesn't take an IV.
      
      This fixes a failure in the extra crypto self-tests:
      
      	alg: skcipher: ivsize for ecb-ppc-spe (16) doesn't match generic impl (0)
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      8255e65d
    • Eric Biggers's avatar
      crypto: powerpc - don't unnecessarily use atomic scatterwalk · 0d6ecb2e
      Eric Biggers authored
      The PowerPC SPE implementations of AES modes only disable preemption
      during the actual encryption/decryption, not during the scatterwalk
      functions.  It's therefore unnecessary to request an atomic scatterwalk.
      So don't do so.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      0d6ecb2e
    • Ard Biesheuvel's avatar
      crypto: aegis128 - duplicate init() and final() hooks in SIMD code · 52828263
      Ard Biesheuvel authored
      In order to speed up aegis128 processing even more, duplicate the init()
      and final() routines as SIMD versions in their entirety. This results
      in a 2x speedup on ARM Cortex-A57 for ~1500 byte packets (using AES
      instructions).
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      52828263
    • Ard Biesheuvel's avatar
      crypto: aegis128 - avoid function pointers for parameterization · 2698bce1
      Ard Biesheuvel authored
      Instead of passing around an ops structure with function pointers,
      which forces indirect calls to be used, refactor the code slightly
      so we can use ordinary function calls. At the same time, switch to
      a static key to decide whether or not the SIMD code path may be used.
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      2698bce1
    • Sumit Garg's avatar
      hwrng: omap - Fix RNG wait loop timeout · be867f98
      Sumit Garg authored
      Existing RNG data read timeout is 200us but it doesn't cover EIP76 RNG
      data rate which takes approx. 700us to produce 16 bytes of output data
      as per testing results. So configure the timeout as 1000us to also take
      account of lack of udelay()'s reliability.
      
      Fixes: 38321242 ("hwrng: omap - Add device variant for SafeXcel IP-76 found in Armada 8K")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarSumit Garg <sumit.garg@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      be867f98
  2. 23 Oct, 2019 21 commits
  3. 18 Oct, 2019 3 commits
  4. 10 Oct, 2019 6 commits