1. 26 7月, 2019 2 次提交
  2. 06 6月, 2019 1 次提交
  3. 30 5月, 2019 3 次提交
  4. 21 5月, 2019 1 次提交
  5. 16 4月, 2019 1 次提交
  6. 10 1月, 2019 1 次提交
  7. 21 12月, 2018 1 次提交
  8. 07 12月, 2018 1 次提交
  9. 09 11月, 2018 3 次提交
  10. 08 10月, 2018 1 次提交
    • H
      s390/zcrypt: multiple zcrypt device nodes support · 00fab235
      Harald Freudenberger 提交于
      This patch is an extension to the zcrypt device driver to provide,
      support and maintain multiple zcrypt device nodes. The individual
      zcrypt device nodes can be restricted in terms of crypto cards,
      domains and available ioctls. Such a device node can be used as a
      base for container solutions like docker to control and restrict
      the access to crypto resources.
      
      The handling is done with a new sysfs subdir /sys/class/zcrypt.
      Echoing a name (or an empty sting) into the attribute "create" creates
      a new zcrypt device node. In /sys/class/zcrypt a new link will appear
      which points to the sysfs device tree of this new device. The
      attribute files "ioctlmask", "apmask" and "aqmask" in this directory
      are used to customize this new zcrypt device node instance. Finally
      the zcrypt device node can be destroyed by echoing the name into
      /sys/class/zcrypt/destroy. The internal structs holding the device
      info are reference counted - so a destroy will not hard remove a
      device but only marks it as removable when the reference counter drops
      to zero.
      
      The mask values are bitmaps in big endian order starting with bit 0.
      So adapter number 0 is the leftmost bit, mask is 0x8000...  The sysfs
      attributes accept 2 different formats:
      * Absolute hex string starting with 0x like "0x12345678" does set
        the mask starting from left to right. If the given string is shorter
        than the mask it is padded with 0s on the right. If the string is
        longer than the mask an error comes back (EINVAL).
      * Relative format - a concatenation (done with ',') of the
        terms +<bitnr>[-<bitnr>] or -<bitnr>[-<bitnr>]. <bitnr> may be any
        valid number (hex, decimal or octal) in the range 0...255. Here are
        some examples:
          "+0-15,+32,-128,-0xFF"
          "-0-255,+1-16,+0x128"
          "+1,+2,+3,+4,-5,-7-10"
      
      A simple usage examples:
      
        # create new zcrypt device 'my_zcrypt':
        echo "my_zcrypt" >/sys/class/zcrypt/create
        # go into the device dir of this new device
        echo "my_zcrypt" >create
        cd my_zcrypt/
        ls -l
        total 0
        -rw-r--r-- 1 root root 4096 Jul 20 15:23 apmask
        -rw-r--r-- 1 root root 4096 Jul 20 15:23 aqmask
        -r--r--r-- 1 root root 4096 Jul 20 15:23 dev
        -rw-r--r-- 1 root root 4096 Jul 20 15:23 ioctlmask
        lrwxrwxrwx 1 root root    0 Jul 20 15:23 subsystem -> ../../../../class/zcrypt
        ...
        # customize this zcrypt node clone
        # enable only adapter 0 and 2
        echo "0xa0" >apmask
        # enable only domain 6
        echo "+6" >aqmask
        # enable all 256 ioctls
        echo "+0-255" >ioctls
        # now the /dev/my_zcrypt may be used
        # finally destroy it
        echo "my_zcrypt" >/sys/class/zcrypt/destroy
      
      Please note that a very similar 'filtering behavior' also applies to
      the parent z90crypt device. The two mask attributes apmask and aqmask
      in /sys/bus/ap act the very same for the z90crypt device node. However
      the implementation here is totally different as the ap bus acts on
      bind/unbind of queue devices and associated drivers but the effect is
      still the same. So there are two filters active for each additional
      zcrypt device node: The adapter/domain needs to be enabled on the ap
      bus level and it needs to be active on the zcrypt device node level.
      Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      00fab235
  11. 03 8月, 2018 1 次提交
  12. 27 7月, 2018 1 次提交
  13. 09 7月, 2018 2 次提交
  14. 27 5月, 2018 1 次提交
  15. 28 4月, 2018 2 次提交
  16. 23 3月, 2018 1 次提交
  17. 03 3月, 2018 1 次提交
  18. 15 2月, 2018 1 次提交
  19. 25 1月, 2018 1 次提交
  20. 03 11月, 2017 2 次提交
  21. 12 10月, 2017 1 次提交
  22. 22 8月, 2017 1 次提交
  23. 18 7月, 2017 4 次提交
  24. 12 6月, 2017 1 次提交
  25. 10 6月, 2017 4 次提交
  26. 21 4月, 2017 1 次提交
    • K
      crypto: exynos - Add new Exynos RNG driver · c46ea13f
      Krzysztof Kozlowski 提交于
      Replace existing hw_ranndom/exynos-rng driver with a new, reworked one.
      This is a driver for pseudo random number generator block which on
      Exynos4 chipsets must be seeded with some value.  On newer Exynos5420
      chipsets it might seed itself from true random number generator block
      but this is not implemented yet.
      
      New driver is a complete rework to use the crypto ALGAPI instead of
      hw_random API.  Rationale for the change:
      1. hw_random interface is for true RNG devices.
      2. The old driver was seeding itself with jiffies which is not a
         reliable source for randomness.
      3. Device generates five random 32-bit numbers in each pass but old
         driver was returning only one 32-bit number thus its performance was
         reduced.
      
      Compatibility with DeviceTree bindings is preserved.
      
      New driver does not use runtime power management but manually enables
      and disables the clock when needed.  This is preferred approach because
      using runtime PM just to toggle clock is huge overhead.
      
      Another difference is reseeding itself with generated random data
      periodically and during resuming from system suspend (previously driver
      was re-seeding itself again with jiffies).
      Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Reviewed-by: NStephan Müller <smueller@chronox.de>
      Reviewed-by: NPrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
      Reviewed-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      c46ea13f