Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto updates from Herbert Xu: "API: - Add the ability to abort a skcipher walk. Algorithms: - Fix XTS to actually do the stealing. - Add library helpers for AES and DES for single-block users. - Add library helpers for SHA256. - Add new DES key verification helper. - Add surrounding bits for ESSIV generator. - Add accelerations for aegis128. - Add test vectors for lzo-rle. Drivers: - Add i.MX8MQ support to caam. - Add gcm/ccm/cfb/ofb aes support in inside-secure. - Add ofb/cfb aes support in media-tek. - Add HiSilicon ZIP accelerator support. Others: - Fix potential race condition in padata. - Use unbound workqueues in padata" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (311 commits) crypto: caam - Cast to long first before pointer conversion crypto: ccree - enable CTS support in AES-XTS crypto: inside-secure - Probe transform record cache RAM sizes crypto: inside-secure - Base RD fetchcount on actual RD FIFO size crypto: inside-secure - Base CD fetchcount on actual CD FIFO size crypto: inside-secure - Enable extended algorithms on newer HW crypto: inside-secure: Corrected configuration of EIP96_TOKEN_CTRL crypto: inside-secure - Add EIP97/EIP197 and endianness detection padata: remove cpu_index from the parallel_queue padata: unbind parallel jobs from specific CPUs padata: use separate workqueues for parallel and serial work padata, pcrypt: take CPU hotplug lock internally in padata_alloc_possible crypto: pcrypt - remove padata cpumask notifier padata: make padata_do_parallel find alternate callback CPU workqueue: require CPU hotplug read exclusion for apply_workqueue_attrs workqueue: unconfine alloc/apply/free_workqueue_attrs() padata: allocate workqueue internally arm64: dts: imx8mq: Add CAAM node random: Use wait_event_freezable() in add_hwgenerator_randomness() crypto: ux500 - Fix COMPILE_TEST warnings ...
This commit is contained in:
@@ -4,8 +4,15 @@
|
||||
|
||||
#ifdef CONFIG_CRYPTO_FIPS
|
||||
extern int fips_enabled;
|
||||
extern struct atomic_notifier_head fips_fail_notif_chain;
|
||||
|
||||
void fips_fail_notify(void);
|
||||
|
||||
#else
|
||||
#define fips_enabled 0
|
||||
|
||||
static inline void fips_fail_notify(void) {}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -12,7 +12,6 @@
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/kobject.h>
|
||||
|
||||
@@ -36,6 +35,7 @@ struct padata_priv {
|
||||
struct parallel_data *pd;
|
||||
int cb_cpu;
|
||||
int cpu;
|
||||
unsigned int seq_nr;
|
||||
int info;
|
||||
void (*parallel)(struct padata_priv *padata);
|
||||
void (*serial)(struct padata_priv *padata);
|
||||
@@ -73,20 +73,14 @@ struct padata_serial_queue {
|
||||
* @serial: List to wait for serialization after reordering.
|
||||
* @pwork: work struct for parallelization.
|
||||
* @swork: work struct for serialization.
|
||||
* @pd: Backpointer to the internal control structure.
|
||||
* @work: work struct for parallelization.
|
||||
* @reorder_work: work struct for reordering.
|
||||
* @num_obj: Number of objects that are processed by this cpu.
|
||||
* @cpu_index: Index of the cpu.
|
||||
*/
|
||||
struct padata_parallel_queue {
|
||||
struct padata_list parallel;
|
||||
struct padata_list reorder;
|
||||
struct parallel_data *pd;
|
||||
struct work_struct work;
|
||||
struct work_struct reorder_work;
|
||||
atomic_t num_obj;
|
||||
int cpu_index;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -110,10 +104,11 @@ struct padata_cpumask {
|
||||
* @reorder_objects: Number of objects waiting in the reorder queues.
|
||||
* @refcnt: Number of objects holding a reference on this parallel_data.
|
||||
* @max_seq_nr: Maximal used sequence number.
|
||||
* @cpumask: The cpumasks in use for parallel and serial workers.
|
||||
* @lock: Reorder lock.
|
||||
* @processed: Number of already processed objects.
|
||||
* @timer: Reorder timer.
|
||||
* @cpu: Next CPU to be processed.
|
||||
* @cpumask: The cpumasks in use for parallel and serial workers.
|
||||
* @reorder_work: work struct for reordering.
|
||||
* @lock: Reorder lock.
|
||||
*/
|
||||
struct parallel_data {
|
||||
struct padata_instance *pinst;
|
||||
@@ -122,17 +117,19 @@ struct parallel_data {
|
||||
atomic_t reorder_objects;
|
||||
atomic_t refcnt;
|
||||
atomic_t seq_nr;
|
||||
struct padata_cpumask cpumask;
|
||||
spinlock_t lock ____cacheline_aligned;
|
||||
unsigned int processed;
|
||||
struct timer_list timer;
|
||||
int cpu;
|
||||
struct padata_cpumask cpumask;
|
||||
struct work_struct reorder_work;
|
||||
spinlock_t lock ____cacheline_aligned;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct padata_instance - The overall control structure.
|
||||
*
|
||||
* @cpu_notifier: cpu hotplug notifier.
|
||||
* @wq: The workqueue in use.
|
||||
* @parallel_wq: The workqueue used for parallel work.
|
||||
* @serial_wq: The workqueue used for serial work.
|
||||
* @pd: The internal control structure.
|
||||
* @cpumask: User supplied cpumasks for parallel and serial works.
|
||||
* @cpumask_change_notifier: Notifiers chain for user-defined notify
|
||||
@@ -144,7 +141,8 @@ struct parallel_data {
|
||||
*/
|
||||
struct padata_instance {
|
||||
struct hlist_node node;
|
||||
struct workqueue_struct *wq;
|
||||
struct workqueue_struct *parallel_wq;
|
||||
struct workqueue_struct *serial_wq;
|
||||
struct parallel_data *pd;
|
||||
struct padata_cpumask cpumask;
|
||||
struct blocking_notifier_head cpumask_change_notifier;
|
||||
@@ -156,11 +154,10 @@ struct padata_instance {
|
||||
#define PADATA_INVALID 4
|
||||
};
|
||||
|
||||
extern struct padata_instance *padata_alloc_possible(
|
||||
struct workqueue_struct *wq);
|
||||
extern struct padata_instance *padata_alloc_possible(const char *name);
|
||||
extern void padata_free(struct padata_instance *pinst);
|
||||
extern int padata_do_parallel(struct padata_instance *pinst,
|
||||
struct padata_priv *padata, int cb_cpu);
|
||||
struct padata_priv *padata, int *cb_cpu);
|
||||
extern void padata_do_serial(struct padata_priv *padata);
|
||||
extern int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,
|
||||
cpumask_var_t cpumask);
|
||||
|
@@ -1,28 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (C) 2014 Red Hat Inc.
|
||||
*
|
||||
* Author: Vivek Goyal <vgoyal@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef SHA256_H
|
||||
#define SHA256_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <crypto/sha.h>
|
||||
|
||||
/*
|
||||
* Stand-alone implementation of the SHA256 algorithm. It is designed to
|
||||
* have as little dependencies as possible so it can be used in the
|
||||
* kexec_file purgatory. In other cases you should use the implementation in
|
||||
* crypto/.
|
||||
*
|
||||
* For details see lib/sha256.c
|
||||
*/
|
||||
|
||||
extern int sha256_init(struct sha256_state *sctx);
|
||||
extern int sha256_update(struct sha256_state *sctx, const u8 *input,
|
||||
unsigned int length);
|
||||
extern int sha256_final(struct sha256_state *sctx, u8 *hash);
|
||||
|
||||
#endif /* SHA256_H */
|
@@ -5,6 +5,9 @@
|
||||
* Copyright (c) 2009 Alexander Clouter <alex@digriz.org.uk>
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_TIMERIOMEM_RNG_H
|
||||
#define _LINUX_TIMERIOMEM_RNG_H
|
||||
|
||||
struct timeriomem_rng_data {
|
||||
void __iomem *address;
|
||||
|
||||
@@ -14,3 +17,5 @@ struct timeriomem_rng_data {
|
||||
/* bits of entropy per 1024 bits read */
|
||||
unsigned int quality;
|
||||
};
|
||||
|
||||
#endif /* _LINUX_TIMERIOMEM_RNG_H */
|
||||
|
@@ -435,6 +435,10 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
|
||||
|
||||
extern void destroy_workqueue(struct workqueue_struct *wq);
|
||||
|
||||
struct workqueue_attrs *alloc_workqueue_attrs(void);
|
||||
void free_workqueue_attrs(struct workqueue_attrs *attrs);
|
||||
int apply_workqueue_attrs(struct workqueue_struct *wq,
|
||||
const struct workqueue_attrs *attrs);
|
||||
int workqueue_set_unbound_cpumask(cpumask_var_t cpumask);
|
||||
|
||||
extern bool queue_work_on(int cpu, struct workqueue_struct *wq,
|
||||
|
Reference in New Issue
Block a user