1. 19 6月, 2015 2 次提交
  2. 18 6月, 2015 2 次提交
    • H
      crypto: drivers - Fix Kconfig selects · 596103cf
      Herbert Xu 提交于
      This patch fixes a number of problems in crypto driver Kconfig
      entries:
      
      1. Select BLKCIPHER instead of BLKCIPHER2.  The latter is internal
      and should not be used outside of the crypto API itself.
      2. Do not select ALGAPI unless you use a legacy type like
      CRYPTO_ALG_TYPE_CIPHER.
      3. Select the algorithm type that you are implementing, e.g., AEAD.
      4. Do not select generic C code such as CBC/ECB unless you use them
      as a fallback.
      5. Remove default n since that is the default default.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      596103cf
    • S
      crypto: caam - fix non-64-bit write/read access · f657f82c
      Steffen Trumtrar 提交于
      The patch
      
      	crypto: caam - Add definition of rd/wr_reg64 for little endian platform
      
      added support for little endian platforms to the CAAM driver. Namely a
      write and read function for 64 bit registers.
      The only user of this functions is the Job Ring driver (drivers/crypto/caam/jr.c).
      It uses the functions to set the DMA addresses for the input/output rings.
      However, at least in the default configuration, the least significant 32 bits are
      always in the base+0x0004 address; independent of the endianness of the bytes itself.
      That means the addresses do not change with the system endianness.
      
      DMA addresses are only 32 bits wide on non-64-bit systems, writing the upper 32 bits
      of this value to the register for the least significant bits results in the DMA address
      being set to 0.
      
      Fix this by always writing the registers in the same way.
      Suggested-by: NRussell King <linux@arm.linux.org.uk>
      Signed-off-by: NSteffen Trumtrar <s.trumtrar@pengutronix.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      f657f82c
  3. 17 6月, 2015 3 次提交
    • H
      crypto: caam - Convert GCM to new AEAD interface · f2147b88
      Herbert Xu 提交于
      This patch converts the caam GCM implementations to the new AEAD
      interface.  This is compile-tested only.
      
      Note that all IV generation for GCM algorithms have been removed.
      The reason is that the current generation uses purely random IVs
      which is not appropriate for counter-based algorithms where we
      first and foremost require uniqueness.
      
      Of course there is no reason why you couldn't implement seqiv or
      seqniv within caam since all they do is xor the sequence number
      with a salt, but since I can't test this on actual hardware I'll
      leave it alone for now.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      f2147b88
    • H
      crypto: caam - Handle errors in dma_map_sg_chained · 6c94711c
      Herbert Xu 提交于
      Currently dma_map_sg_chained does not handle errors from the
      underlying dma_map_sg calls.  This patch adds rollback in case
      of an error by simply calling dma_unmap_sg_chained for the ones
      that we've already mapped.
      
      All current callers ignore the return value so this should have
      no impact on them.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      6c94711c
    • H
      crypto: nx - Convert GCM to new AEAD interface · 201f28f0
      Herbert Xu 提交于
      This patch converts the nx GCM implementations to the new AEAD
      interface.  This is compile-tested only.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      201f28f0
  4. 16 6月, 2015 4 次提交
  5. 15 6月, 2015 2 次提交
    • D
      crypto: nx - replace NX842_MEM_COMPRESS with function · 2c6f6eab
      Dan Streetman 提交于
      Replace the NX842_MEM_COMPRESS define with a function that returns the
      specific platform driver's required working memory size.
      
      The common nx-842.c driver refuses to load if there is no platform
      driver present, so instead of defining an approximate working memory
      size that's the maximum approximate size of both platform driver's
      size requirements, the platform driver can directly provide its
      specific, i.e. sizeof(struct nx842_workmem), size requirements which
      the 842-nx crypto compression driver will use.
      
      This saves memory by both reducing the required size of each driver
      to the specific sizeof() amount, as well as using the specific loaded
      platform driver's required amount, instead of the maximum of both.
      Signed-off-by: NDan Streetman <ddstreet@ieee.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      2c6f6eab
    • D
      crypto: nx - move include/linux/nx842.h into drivers/crypto/nx/nx-842.h · 32be6d3e
      Dan Streetman 提交于
      Move the contents of the include/linux/nx842.h header file into the
      drivers/crypto/nx/nx-842.h header file.  Remove the nx842.h header
      file and its entry in the MAINTAINERS file.
      
      The include/linux/nx842.h header originally was there because the
      crypto/842.c driver needed it to communicate with the nx-842 hw
      driver.  However, that crypto compression driver was moved into
      the drivers/crypto/nx/ directory, and now can directly include the
      nx-842.h header.  Nothing else needs the public include/linux/nx842.h
      header file, as all use of the nx-842 hardware driver will be through
      the "842-nx" crypto compression driver, since the direct nx-842 api is
      very limited in the buffer alignments and sizes that it will accept,
      and the crypto compression interface handles those limitations and
      allows any alignment and size buffers.
      Signed-off-by: NDan Streetman <ddstreet@ieee.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      32be6d3e
  6. 12 6月, 2015 3 次提交
  7. 09 6月, 2015 3 次提交
  8. 04 6月, 2015 1 次提交
    • D
      crypto: nx - fix nx-842 pSeries driver minimum buffer size · 3154de71
      Dan Streetman 提交于
      Reduce the nx-842 pSeries driver minimum buffer size from 128 to 8.
      Also replace the single use of IO_BUFFER_ALIGN macro with the standard
      and correct DDE_BUFFER_ALIGN.
      
      The hw sometimes rejects buffers that contain padding past the end of the
      8-byte aligned section where it sees the "end" marker.  With the minimum
      buffer size set too high, some highly compressed buffers were being padded
      and the hw was incorrectly rejecting them; this sets the minimum correctly
      so there will be no incorrect padding.
      Signed-off-by: NDan Streetman <ddstreet@ieee.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      3154de71
  9. 03 6月, 2015 2 次提交
    • T
      crypto: ccp - Protect against poorly marked end of sg list · fb43f694
      Tom Lendacky 提交于
      Scatter gather lists can be created with more available entries than are
      actually used (e.g. using sg_init_table() to reserve a specific number
      of sg entries, but in actuality using something less than that based on
      the data length).  The caller sometimes fails to mark the last entry
      with sg_mark_end().  In these cases, sg_nents() will return the original
      size of the sg list as opposed to the actual number of sg entries that
      contain valid data.
      
      On arm64, if the sg_nents() value is used in a call to dma_map_sg() in
      this situation, then it causes a BUG_ON in lib/swiotlb.c because an
      "empty" sg list entry results in dma_capable() returning false and
      swiotlb trying to create a bounce buffer of size 0. This occurred in
      the userspace crypto interface before being fixed by
      
      0f477b65 ("crypto: algif - Mark sgl end at the end of data")
      
      Protect against this by using the new sg_nents_for_len() function which
      returns only the number of sg entries required to meet the desired
      length and supplying that value to dma_map_sg().
      Signed-off-by: NTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      fb43f694
    • D
      crypto: nx - prevent nx 842 load if no hw driver · 3e648cbe
      Dan Streetman 提交于
      Change the nx-842 common driver to wait for loading of both platform
      drivers, and fail loading if the platform driver pointer is not set.
      Add an independent platform driver pointer, that the platform drivers
      set if they find they are able to load (i.e. if they find their platform
      devicetree node(s)).
      
      The problem is currently, the main nx-842 driver will stay loaded even
      if there is no platform driver and thus no possible way it can do any
      compression or decompression.  This allows the crypto 842-nx driver
      to load even if it won't actually work.  For crypto compression users
      (e.g. zswap) that expect an available crypto compression driver to
      actually work, this is bad.  This patch fixes that, so the 842-nx crypto
      compression driver won't load if it doesn't have the driver and hardware
      available to perform the compression.
      Signed-off-by: NDan Streetman <ddstreet@ieee.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      3e648cbe
  10. 27 5月, 2015 2 次提交
  11. 25 5月, 2015 1 次提交
  12. 22 5月, 2015 3 次提交
  13. 18 5月, 2015 3 次提交
  14. 15 5月, 2015 4 次提交
  15. 13 5月, 2015 5 次提交