Re: [PATCH v5 24/25] s390/pkey: Provide and pass xflags within pkey and zcrypt layers

Holger Dengler
2025-04-16T09:37:01Z

On 15/04/2025 16:24, Harald Freudenberger wrote:
> Provide and pass the xflag parameter from pkey ioctls through
> the pkey handler and further down to the implementations
> (CCA, EP11, PCKMO and UV). So all the code is now prepared
> and ready to support xflags ("execution flag").
>
> The pkey layer supports the xflag PKEY_XFLAG_NOMEMALLOC: If this
> flag is given in the xflags parameter, the pkey implementation is
> not allowed to allocate memory but instead should fall back to use
> preallocated memory or simple fail with -ENOMEM. This flag is for
> protected key derive within a cipher or similar which must not
> allocate memory which would cause io operations - see also the
> CRYPTO_ALG_ALLOCATES_MEMORY flag in crypto.h.
>
> Within the pkey handlers this flag is then to be translated to
> appropriate zcrypt flags before any zcrypt related functions

reword?: appropriate zcrypt xflags

> are called. So the PKEY_XFLAG_NOMEMALLOC translates to
> ZCRYPT_XFLAG_NOMEMALLOC - If this flag is set, no memory
> allocations which may trigger any IO operations are done.
>
> The pkey in-kernel pkey API still does not provide this xflag
> param. That's intended to come with a separate patch which
> enables this functionality.
>
> Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
> Reviewed-by: Holger Dengler <dengler@linux.ibm.com>

Looks good now, thx.

--
Mit freundlichen Grüßen / Kind regards
Holger Dengler
--
IBM Systems, Linux on IBM Z Development
dengler@linux.ibm.com