lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 8 Jan 2020 16:59:51 +0000
From:   Horia Geanta <horia.geanta@....com>
To:     Iuliana Prodan <iuliana.prodan@....com>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        Aymen Sghaier <aymen.sghaier@....com>
CC:     "David S. Miller" <davem@...emloft.net>,
        "linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>
Subject: Re: [PATCH v2 06/10] crypto: caam - refactor caam_jr_enqueue

On 1/3/2020 3:04 AM, Iuliana Prodan wrote:
> Added a new struct - caam_{skcipher, akcipher, ahash, aead}_request_entry,
> to keep each request information. This has a specific crypto request and
> a bool to check if the request has backlog flag or not.
> This struct is passed to CAAM, via enqueue function - caam_jr_enqueue.
> 
> This is done for later use, on backlogging support in CAAM.
[...]
> diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
> index 21b6172..34662b4 100644
> --- a/drivers/crypto/caam/caamalg.c
> +++ b/drivers/crypto/caam/caamalg.c
> @@ -871,6 +871,17 @@ static int xts_skcipher_setkey(struct crypto_skcipher *skcipher, const u8 *key,
>  }
>  
>  /*
> + * caam_aead_request_entry - storage for tracking each aead request
> + *                           that is processed by a ring
> + * @base: common attributes for aead requests
> + * @bklog: stored to determine if the request needs backlog
> + */
> +struct caam_aead_request_entry {
> +	struct aead_request *base;
> +	bool bklog;
> +};
> +
> +/*
>   * aead_edesc - s/w-extended aead descriptor
>   * @src_nents: number of segments in input s/w scatterlist
>   * @dst_nents: number of segments in output s/w scatterlist
> @@ -878,6 +889,7 @@ static int xts_skcipher_setkey(struct crypto_skcipher *skcipher, const u8 *key,
>   * @mapped_dst_nents: number of segments in output h/w link table
>   * @sec4_sg_bytes: length of dma mapped sec4_sg space
>   * @sec4_sg_dma: bus physical mapped address of h/w link table
> + * @jrentry: information about the current request that is processed by a ring
>   * @sec4_sg: pointer to h/w link table
>   * @hw_desc: the h/w job descriptor followed by any referenced link tables
>   */
> @@ -888,11 +900,23 @@ struct aead_edesc {
>  	int mapped_dst_nents;
>  	int sec4_sg_bytes;
>  	dma_addr_t sec4_sg_dma;
> +	struct caam_aead_request_entry jrentry;
>  	struct sec4_sg_entry *sec4_sg;
>  	u32 hw_desc[];
>  };
>  
Now that most of the backlogging logic moved from the backend (jr.c)
to frontends (caamalg.c, caamhash.c etc.), it looks like there's no need for
all the *_request_entry structures.
Instead, bklog flag could be added directly into the corresponding
*_edesc structure.

Horia

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ