linux-stable/drivers/s390/crypto
Tony Krowiak 1918f2b20c s390/vfio-ap: bypass unnecessary processing of AP resources
It is not necessary to go through the process of validation, linking of
queues to mdev and vice versa and filtering the APQNs assigned to the
matrix mdev to build an AP configuration for a guest if an adapter or
domain being assigned is already assigned to the matrix mdev. Likewise, it
is not necessary to proceed through the process the unassignment of an
adapter, domain or control domain if it is not assigned to the matrix mdev.

Since it is not necessary to process assignment of a resource already
assigned or process unassignment of a resource that is been assigned,
this patch will bypass all assignment/unassignment operations for an
adapter, domain or control domain under these circumstances.

Not only is assignment of a duplicate adapter or domain unnecessary, it
will also cause a hang situation when removing the matrix mdev to which it is
assigned. The reason is because the same vfio_ap_queue objects with an
APQN containing the APID of the adapter or APQI of the domain being
assigned will get added multiple times to the hashtable that holds them.
This results in the pprev and next pointers of the hlist_node (mdev_qnode
field in the vfio_ap_queue object) pointing to the queue object itself
resulting in an interminable loop when the mdev is removed and the queue
table is iterated to reset the queues.

Cc: stable@vger.kernel.org
Fixes: 11cb2419fa ("s390/vfio-ap: manage link between queue struct and matrix mdev")
Reported-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2022-09-21 22:33:16 +02:00
..
ap_bus.c s390/ap: fix crash on older machines based on QCI info missing 2022-08-15 17:19:52 +02:00
ap_bus.h s390/ap: fix crash on older machines based on QCI info missing 2022-08-15 17:19:52 +02:00
ap_card.c s390/zcrypt: handle checkstopped cards with new state 2022-03-08 00:33:00 +01:00
ap_debug.h s390/zcrypt: rework of debug feature messages 2021-10-26 15:21:27 +02:00
ap_queue.c vfio/ap: Pass in physical address of ind to ap_aqic() 2022-07-23 07:29:10 -06:00
Makefile
pkey_api.c s390/cpufeature: rework to allow more than only hwcap bits 2022-07-19 16:18:49 +02:00
vfio_ap_debug.h s390-vfio-ap: introduces s390 kernel debug feature for vfio_ap device driver 2022-02-06 23:31:29 +01:00
vfio_ap_drv.c s390/vfio-ap: handle config changed and scan complete notification 2022-07-19 16:18:12 +02:00
vfio_ap_ops.c s390/vfio-ap: bypass unnecessary processing of AP resources 2022-09-21 22:33:16 +02:00
vfio_ap_private.h s390 updates for 5.20 merge window 2022-08-06 17:05:21 -07:00
zcrypt_api.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_api.h s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_card.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_cca_key.h s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_ccamisc.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_ccamisc.h s390/zcrypt: add display of ASYM master key verification pattern 2022-04-25 13:54:13 +02:00
zcrypt_cex2a.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_cex2a.h
zcrypt_cex2c.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_cex2c.h
zcrypt_cex4.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_cex4.h
zcrypt_debug.h s390/zcrypt: rework of debug feature messages 2021-10-26 15:21:27 +02:00
zcrypt_ep11misc.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_ep11misc.h s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_error.h s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_msgtype6.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_msgtype6.h s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_msgtype50.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00
zcrypt_msgtype50.h s390/zcrypt: Support CPRB minor version T7 2022-03-08 00:33:00 +01:00
zcrypt_queue.c s390/zcrypt: code cleanup 2022-04-25 13:54:14 +02:00