s390/zcrypt: introduce new internal AP queue se_bound attribute
authorHarald Freudenberger <freude@linux.ibm.com>
Tue, 12 Sep 2023 08:08:51 +0000 (10:08 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 16 Oct 2023 11:04:09 +0000 (13:04 +0200)
commita19a161482b1739c2207861d086403389dc1bd47
tree6b83d98ddc5dae57d7f67939a2d4c400e5cd71b1
parent32d1d9204f8db3360be55e65bd182a1a68f93308
s390/zcrypt: introduce new internal AP queue se_bound attribute

This patch introduces a new AP queue internal attribute
se_bound which reflects the bound state of an APQN within
a Secure Execution environment.

With introduction of Secure Execution guests now an
AP firmware queue needs to be bound to the guest before
usage. This patch introduces a new internal attribute
reflecting this bound state and some glue code to handle
this new field during lifetime of an AP queue device.

Together with that now the zcrypt scheduler considers
the state of the AP queues when a message is about to be
distributed among the existing queues. There is a new
function ap_queue_usable() which returns true only when
all conditions for using this AP queue device are fulfilled.
In details this means: the AP queue needs to be configured,
not checkstopped and within an SE environment it needs
to be bound. So the new function gives and indication
if the AP queue device is ready to serve requests or not.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
drivers/s390/crypto/ap_bus.h
drivers/s390/crypto/ap_queue.c
drivers/s390/crypto/zcrypt_api.c