]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 8 Oct 2014 10:44:48 +0000 (06:44 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 8 Oct 2014 10:44:48 +0000 (06:44 -0400)
Pull crypto update from Herbert Xu:
 - add multibuffer infrastructure (single_task_running scheduler helper,
   OKed by Peter on lkml.
 - add SHA1 multibuffer implementation for AVX2.
 - reenable "by8" AVX CTR optimisation after fixing counter overflow.
 - add APM X-Gene SoC RNG support.
 - SHA256/SHA512 now handles unaligned input correctly.
 - set lz4 decompressed length correctly.
 - fix algif socket buffer allocation failure for 64K page machines.
 - misc fixes

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (47 commits)
  crypto: sha - Handle unaligned input data in generic sha256 and sha512.
  Revert "crypto: aesni - disable "by8" AVX CTR optimization"
  crypto: aesni - remove unused defines in "by8" variant
  crypto: aesni - fix counter overflow handling in "by8" variant
  hwrng: printk replacement
  crypto: qat - Removed unneeded partial state
  crypto: qat - Fix typo in name of tasklet_struct
  crypto: caam - Dynamic allocation of addresses for various memory blocks in CAAM.
  crypto: mcryptd - Fix typos in CRYPTO_MCRYPTD description
  crypto: algif - avoid excessive use of socket buffer in skcipher
  arm64: dts: add random number generator dts node to APM X-Gene platform.
  Documentation: rng: Add X-Gene SoC RNG driver documentation
  hwrng: xgene - add support for APM X-Gene SoC RNG support
  crypto: mv_cesa - Add missing #define
  crypto: testmgr - add test for lz4 and lz4hc
  crypto: lz4,lz4hc - fix decompression
  crypto: qat - Use pci_enable_msix_exact() instead of pci_enable_msix()
  crypto: drbg - fix maximum value checks on 32 bit systems
  crypto: drbg - fix sparse warning for cpu_to_be[32|64]
  crypto: sha-mb - sha1_mb_alg_state can be static
  ...

1  2 
crypto/Kconfig
drivers/crypto/qat/qat_common/adf_ctl_drv.c
include/linux/sched.h

diff --combined crypto/Kconfig
index 77daef031db5df6d91855d56433546b5db61fa9d,3a1c2b3497adfe881eb0a28595d70a96ba54d3cd..87bbc9c1e681cb3b118aef05c9bc8f663550a277
@@@ -158,6 -158,20 +158,20 @@@ config CRYPTO_CRYPT
          converts an arbitrary synchronous software crypto algorithm
          into an asynchronous algorithm that executes in a kernel thread.
  
+ config CRYPTO_MCRYPTD
+       tristate "Software async multi-buffer crypto daemon"
+       select CRYPTO_BLKCIPHER
+       select CRYPTO_HASH
+       select CRYPTO_MANAGER
+       select CRYPTO_WORKQUEUE
+       help
+         This is a generic software asynchronous crypto daemon that
+         provides the kernel thread to assist multi-buffer crypto
+         algorithms for submitting jobs and flushing jobs in multi-buffer
+         crypto algorithms.  Multi-buffer crypto algorithms are executed
+         in the context of this kernel thread and drivers can post
+         their crypto request asynchronously to be processed by this daemon.
  config CRYPTO_AUTHENC
        tristate "Authenc support"
        select CRYPTO_AEAD
@@@ -543,7 -557,7 +557,7 @@@ config CRYPTO_SHA1_AR
  
  config CRYPTO_SHA1_ARM_NEON
        tristate "SHA1 digest algorithm (ARM NEON)"
 -      depends on ARM && KERNEL_MODE_NEON && !CPU_BIG_ENDIAN
 +      depends on ARM && KERNEL_MODE_NEON
        select CRYPTO_SHA1_ARM
        select CRYPTO_SHA1
        select CRYPTO_HASH
@@@ -559,6 -573,22 +573,22 @@@ config CRYPTO_SHA1_PP
          This is the powerpc hardware accelerated implementation of the
          SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2).
  
+ config CRYPTO_SHA1_MB
+       tristate "SHA1 digest algorithm (x86_64 Multi-Buffer, Experimental)"
+       depends on X86 && 64BIT
+       select CRYPTO_SHA1
+       select CRYPTO_HASH
+       select CRYPTO_MCRYPTD
+       help
+         SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2) implemented
+         using multi-buffer technique.  This algorithm computes on
+         multiple data lanes concurrently with SIMD instructions for
+         better throughput.  It should not be enabled by default but
+         used when there is significant amount of work to keep the keep
+         the data lanes filled to get performance benefit.  If the data
+         lanes remain unfilled, a flush operation will be initiated to
+         process the crypto jobs, adding a slight latency.
  config CRYPTO_SHA256
        tristate "SHA224 and SHA256 digest algorithm"
        select CRYPTO_HASH
@@@ -603,7 -633,7 +633,7 @@@ config CRYPTO_SHA512_SPARC6
  
  config CRYPTO_SHA512_ARM_NEON
        tristate "SHA384 and SHA512 digest algorithm (ARM NEON)"
 -      depends on ARM && KERNEL_MODE_NEON && !CPU_BIG_ENDIAN
 +      depends on ARM && KERNEL_MODE_NEON
        select CRYPTO_SHA512
        select CRYPTO_HASH
        help
index 6a92284a86b20c485764d327f1f9e7be70c78d9f,6f7816e2c4214127deeb89d29aac2fedba2bd250..244d73378f0e063e37392ede376cf44dd4b831bc
@@@ -111,7 -111,7 +111,7 @@@ static int adf_chr_drv_create(void
        drv_device = device_create(adt_ctl_drv.drv_class, NULL,
                                   MKDEV(adt_ctl_drv.major, 0),
                                   NULL, DEVICE_NAME);
-       if (!drv_device) {
+       if (IS_ERR(drv_device)) {
                pr_err("QAT: failed to create device\n");
                goto err_cdev_del;
        }
@@@ -436,7 -436,7 +436,7 @@@ static long adf_ctl_ioctl(struct file *
                ret = adf_ctl_ioctl_get_status(fp, cmd, arg);
                break;
        default:
 -              pr_err("QAT: Invalid ioclt\n");
 +              pr_err("QAT: Invalid ioctl\n");
                ret = -EFAULT;
                break;
        }
diff --combined include/linux/sched.h
index b867a4dab38a2a4491f54b28b7aa2b809a4dad22,e6d2c056d8e0a6b851cc2292e775f40eaa86bc69..9c6353d9e63ad024489daaac74c5ce04dbe39322
@@@ -167,6 -167,7 +167,7 @@@ extern int nr_threads
  DECLARE_PER_CPU(unsigned long, process_counts);
  extern int nr_processes(void);
  extern unsigned long nr_running(void);
+ extern bool single_task_running(void);
  extern unsigned long nr_iowait(void);
  extern unsigned long nr_iowait_cpu(int cpu);
  extern void get_iowait_load(unsigned long *nr_waiters, unsigned long *load);
@@@ -1903,6 -1904,8 +1904,6 @@@ extern void thread_group_cputime_adjust
  #define PF_KTHREAD    0x00200000      /* I am a kernel thread */
  #define PF_RANDOMIZE  0x00400000      /* randomize virtual address space */
  #define PF_SWAPWRITE  0x00800000      /* Allowed to write to swap */
 -#define PF_SPREAD_PAGE        0x01000000      /* Spread page cache over cpuset */
 -#define PF_SPREAD_SLAB        0x02000000      /* Spread some slab caches over cpuset */
  #define PF_NO_SETAFFINITY 0x04000000  /* Userland is not allowed to meddle with cpus_allowed */
  #define PF_MCE_EARLY    0x08000000      /* Early kill for mce process policy */
  #define PF_MUTEX_TESTER       0x20000000      /* Thread belongs to the rt mutex tester */
@@@ -1955,31 -1958,17 +1956,31 @@@ static inline void memalloc_noio_restor
  }
  
  /* Per-process atomic flags. */
 -#define PFA_NO_NEW_PRIVS 0x00000001   /* May not gain new privileges. */
 +#define PFA_NO_NEW_PRIVS 0    /* May not gain new privileges. */
 +#define PFA_SPREAD_PAGE  1      /* Spread page cache over cpuset */
 +#define PFA_SPREAD_SLAB  2      /* Spread some slab caches over cpuset */
  
 -static inline bool task_no_new_privs(struct task_struct *p)
 -{
 -      return test_bit(PFA_NO_NEW_PRIVS, &p->atomic_flags);
 -}
  
 -static inline void task_set_no_new_privs(struct task_struct *p)
 -{
 -      set_bit(PFA_NO_NEW_PRIVS, &p->atomic_flags);
 -}
 +#define TASK_PFA_TEST(name, func)                                     \
 +      static inline bool task_##func(struct task_struct *p)           \
 +      { return test_bit(PFA_##name, &p->atomic_flags); }
 +#define TASK_PFA_SET(name, func)                                      \
 +      static inline void task_set_##func(struct task_struct *p)       \
 +      { set_bit(PFA_##name, &p->atomic_flags); }
 +#define TASK_PFA_CLEAR(name, func)                                    \
 +      static inline void task_clear_##func(struct task_struct *p)     \
 +      { clear_bit(PFA_##name, &p->atomic_flags); }
 +
 +TASK_PFA_TEST(NO_NEW_PRIVS, no_new_privs)
 +TASK_PFA_SET(NO_NEW_PRIVS, no_new_privs)
 +
 +TASK_PFA_TEST(SPREAD_PAGE, spread_page)
 +TASK_PFA_SET(SPREAD_PAGE, spread_page)
 +TASK_PFA_CLEAR(SPREAD_PAGE, spread_page)
 +
 +TASK_PFA_TEST(SPREAD_SLAB, spread_slab)
 +TASK_PFA_SET(SPREAD_SLAB, spread_slab)
 +TASK_PFA_CLEAR(SPREAD_SLAB, spread_slab)
  
  /*
   * task->jobctl flags
@@@ -2620,22 -2609,9 +2621,22 @@@ static inline void setup_thread_stack(s
        task_thread_info(p)->task = p;
  }
  
 +/*
 + * Return the address of the last usable long on the stack.
 + *
 + * When the stack grows down, this is just above the thread
 + * info struct. Going any lower will corrupt the threadinfo.
 + *
 + * When the stack grows up, this is the highest address.
 + * Beyond that position, we corrupt data on the next page.
 + */
  static inline unsigned long *end_of_stack(struct task_struct *p)
  {
 +#ifdef CONFIG_STACK_GROWSUP
 +      return (unsigned long *)((unsigned long)task_thread_info(p) + THREAD_SIZE) - 1;
 +#else
        return (unsigned long *)(task_thread_info(p) + 1);
 +#endif
  }
  
  #endif