linux/drivers/s390
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
..
block s390/dasd: Establish DMA alignment 2022-08-04 16:19:15 -06:00
char s390 updates for 5.20 merge window 2022-08-06 17:05:21 -07:00
cio VFIO updates for v6.0-rc1 2022-08-06 08:59:35 -07:00
crypto s390/vfio-ap: bypass unnecessary processing of AP resources 2022-09-21 22:33:16 +02:00
net s390/qeth: cache link_info for ethtool 2022-08-08 20:57:56 -07:00
scsi scsi: zfcp: Fix missing auto port scan and thus missing target ports 2022-08-01 19:50:00 -04:00
virtio virtio: Revert "virtio: find_vqs() add arg sizes" 2022-08-16 01:40:24 -04:00
Makefile