Re: [PATCH v4 22/24] s390/pkey: Use preallocated memory for retrieve of UV secret metadata

Steffen Eiden
2025-04-14T08:03:02Z

On Wed, Apr 09, 2025 at 04:03:03PM +0200, Harald Freudenberger wrote:
> The pkey uv functions may be called in a situation where memory
> allocations which trigger IO operations are not allowed. An example:
> decryption of the swap partition with protected key (PAES).
>
> The pkey uv code takes care of this by holding one preallocated
> struct uv_secret_list to be used with the new UV function
> uv_find_secret(). The older function uv_get_secret_metadata()
> used before always allocates/frees an ephemeral memory buffer.
> The preallocated struct is concurrency protected by a mutex.
>
> Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>

Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>

One suggestion:

With this patch `uv_get_secret_metadata` is no longer used by any code.
I built this API specific for pkey so I think you should remove that export
and the function from the codebase to reduce dead code.

Steffen