1. 26 Aug, 2022 34 commits
  2. 19 Aug, 2022 6 commits
    • Martin Kaiser's avatar
      hwrng: imx-rngc - use KBUILD_MODNAME as driver name · 47d35bf2
      Martin Kaiser authored
      Use KBUILD_MODNAME instead of hard coding the driver name.
      Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      47d35bf2
    • Tuo Cao's avatar
      crypto: artpec6 - move spin_lock_bh to spin_lock in tasklet · 90cb3ca2
      Tuo Cao authored
      it is unnecessary to call spin_lock_bh in a tasklet.
      Signed-off-by: default avatarTuo Cao <91tuocao@gmail.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      90cb3ca2
    • Robert Elliott's avatar
      crypto: testmgr - don't generate WARN for missing modules · a76bd86a
      Robert Elliott authored
      This userspace command:
          modprobe tcrypt
      or
          modprobe tcrypt mode=0
      
      runs all the tcrypt test cases numbered <200 (i.e., all the
      test cases calling tcrypt_test() and returning return values).
      
      Tests are sparsely numbered from 0 to 1000. For example:
          modprobe tcrypt mode=12
      tests sha512, and
          modprobe tcrypt mode=152
      tests rfc4543(gcm(aes))) - AES-GCM as GMAC
      
      The test manager generates WARNING crashdumps every time it attempts
      a test using an algorithm that is not available (not built-in to the
      kernel or available as a module):
      
          alg: skcipher: failed to allocate transform for ecb(arc4): -2
          ------------[ cut here ]-----------
          alg: self-tests for ecb(arc4) (ecb(arc4)) failed (rc=-2)
          WARNING: CPU: 9 PID: 4618 at crypto/testmgr.c:5777
      alg_test+0x30b/0x510
          [50 more lines....]
      
          ---[ end trace 0000000000000000 ]---
      
      If the kernel is compiled with CRYPTO_USER_API_ENABLE_OBSOLETE
      disabled (the default), then these algorithms are not compiled into
      the kernel or made into modules and trigger WARNINGs:
          arc4 tea xtea khazad anubis xeta seed
      
      Additionally, any other algorithms that are not enabled in .config
      will generate WARNINGs. In RHEL 9.0, for example, the default
      selection of algorithms leads to 16 WARNING dumps.
      
      One attempt to fix this was by modifying tcrypt_test() to check
      crypto_has_alg() and immediately return 0 if crypto_has_alg() fails,
      rather than proceed and return a non-zero error value that causes
      the caller (alg_test() in crypto/testmgr.c) to invoke WARN().
      That knocks out too many algorithms, though; some combinations
      like ctr(des3_ede) would work.
      
      Instead, change the condition on the WARN to ignore a return
      value is ENOENT, which is the value returned when the algorithm
      or combination of algorithms doesn't exist. Add a pr_warn to
      communicate that information in case the WARN is skipped.
      
      This approach allows algorithm tests to work that are combinations,
      not provided by one driver, like ctr(blowfish).
      
      Result - no more WARNINGs:
      modprobe tcrypt
      [  115.541765] tcrypt: testing md5
      [  115.556415] tcrypt: testing sha1
      [  115.570463] tcrypt: testing ecb(des)
      [  115.585303] cryptomgr: alg: skcipher: failed to allocate transform for ecb(des): -2
      [  115.593037] cryptomgr: alg: self-tests for ecb(des) using ecb(des) failed (rc=-2)
      [  115.593038] tcrypt: testing cbc(des)
      [  115.610641] cryptomgr: alg: skcipher: failed to allocate transform for cbc(des): -2
      [  115.618359] cryptomgr: alg: self-tests for cbc(des) using cbc(des) failed (rc=-2)
      ...
      Signed-off-by: default avatarRobert Elliott <elliott@hpe.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      a76bd86a
    • Robert Elliott's avatar
      crypto: x86/sha512 - load based on CPU features · aa031b8f
      Robert Elliott authored
      x86 optimized crypto modules built as modules rather than built-in
      to the kernel end up as .ko files in the filesystem, e.g., in
      /usr/lib/modules. If the filesystem itself is a module, these might
      not be available when the crypto API is initialized, resulting in
      the generic implementation being used (e.g., sha512_transform rather
      than sha512_transform_avx2).
      
      In one test case, CPU utilization in the sha512 function dropped
      from 15.34% to 7.18% after forcing loading of the optimized module.
      
      Add module aliases for this x86 optimized crypto module based on CPU
      feature bits so udev gets a chance to load them later in the boot
      process when the filesystems are all running.
      Signed-off-by: default avatarRobert Elliott <elliott@hpe.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      aa031b8f
    • Weili Qian's avatar
      crypto: hisilicon/qm - remove unneeded hardware cache write back · 6a088a2c
      Weili Qian authored
      Data in the hardware cache needs to be written back to the memory
      before the queue memory is released. Currently, the queue memory is
      applied for when the driver is loaded and released when the driver is
      removed. Therefore, the hardware cache does not need to be written back
      when process puts queue.
      Signed-off-by: default avatarWeili Qian <qianweili@huawei.com>
      Signed-off-by: default avatarYang Shen <shenyang39@huawei.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      6a088a2c
    • Junchong Pan's avatar
      crypto: hisilicon/qm - remove unneeded data storage · 1129d2d5
      Junchong Pan authored
      The dump_show() is used to output hardware information for error locating.
      It is not need to apply for memory to temporarily store the converted data.
      It can directly output the data. Therefore, remove some unnecessary code.
      Signed-off-by: default avatarJunchong Pan <panjunchong@hisilicon.com>
      Signed-off-by: default avatarYang Shen <shenyang39@huawei.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      1129d2d5