diff options
author | Tony Krowiak <akrowiak@linux.ibm.com> | 2022-03-17 00:46:38 +0300 |
---|---|---|
committer | Alexander Gordeev <agordeev@linux.ibm.com> | 2022-07-19 17:18:10 +0300 |
commit | b84eb8e05057f6f329e28f2563668340ea14184b (patch) | |
tree | ae7a2fa14b460e6a46b8e464f812bbdea4f21f2c /drivers/s390/virtio | |
parent | 21195eb038bcb4c21daef761e8b18f3cc9f22020 (diff) | |
download | linux-b84eb8e05057f6f329e28f2563668340ea14184b.tar.xz |
s390/vfio-ap: use proper locking order when setting/clearing KVM pointer
The group notifier that handles the VFIO_GROUP_NOTIFY_SET_KVM event must
use the required locks in proper locking order to dynamically update the
guest's APCB. The proper locking order is:
1. matrix_dev->guests_lock: required to use the KVM pointer to
update a KVM guest's APCB.
2. matrix_mdev->kvm->lock: required to update a KVM guest's APCB.
3. matrix_dev->mdevs_lock: required to store or access the data
stored in a struct ap_matrix_mdev instance.
Two macros are introduced to acquire and release the locks in the proper
order. These macros are now used by the group notifier functions.
Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Jason J. Herne <jjherne@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'drivers/s390/virtio')
0 files changed, 0 insertions, 0 deletions