lkml.org 
[lkml]   [2019]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH, RFC 26/62] keys/mktme: Move the MKTME payload into a cache aligned structure
On Wed, May 08, 2019 at 05:43:46PM +0300, Kirill A. Shutemov wrote:

> +/* Copy the payload to the HW programming structure and program this KeyID */
> +static int mktme_program_keyid(int keyid, struct mktme_payload *payload)
> +{
> + struct mktme_key_program *kprog = NULL;
> + int ret;
> +
> + kprog = kmem_cache_zalloc(mktme_prog_cache, GFP_ATOMIC);

Why GFP_ATOMIC, afaict neither of the usage is with a spinlock held.

> + if (!kprog)
> + return -ENOMEM;
> +
> + /* Hardware programming requires cached aligned struct */
> + kprog->keyid = keyid;
> + kprog->keyid_ctrl = payload->keyid_ctrl;
> + memcpy(kprog->key_field_1, payload->data_key, MKTME_AES_XTS_SIZE);
> + memcpy(kprog->key_field_2, payload->tweak_key, MKTME_AES_XTS_SIZE);
> +
> + ret = MKTME_PROG_SUCCESS; /* Future programming call */
> + kmem_cache_free(mktme_prog_cache, kprog);
> + return ret;
> +}

\
 
 \ /
  Last update: 2019-06-14 13:35    [W:0.479 / U:7.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site