s390/vfio-ap: allow assignment of unavailable AP queues to mdev device
authorTony Krowiak <akrowiak@linux.ibm.com>
Tue, 15 Dec 2020 02:14:54 +0000 (21:14 -0500)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Tue, 19 Jul 2022 14:18:09 +0000 (16:18 +0200)
commite2126a73746ec6d5f519edf5bf33d76347a51ee9
tree311cfd66f24cbefa7222af0a7610a89cbe2dd7ad
parent48cae940c31d2407d860d87c41d5f9871c0521db
s390/vfio-ap: allow assignment of unavailable AP queues to mdev device

The current implementation does not allow assignment of an AP adapter or
domain to an mdev device if each APQN resulting from the assignment
does not reference an AP queue device that is bound to the vfio_ap device
driver. This patch allows assignment of AP resources to the matrix mdev as
long as the APQNs resulting from the assignment:
   1. Are not reserved by the AP BUS for use by the zcrypt device drivers.
   2. Are not assigned to another matrix mdev.

The rationale behind this is that the AP architecture does not preclude
assignment of APQNs to an AP configuration profile that are not available
to the system.

Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
drivers/s390/crypto/vfio_ap_ops.c