• Tony Krowiak's avatar
    s390/vfio-ap: prepare for dynamic update of guest's APCB on assign/unassign · 8ee13ad9
    Tony Krowiak authored
    The functions backing the matrix mdev's sysfs attribute interfaces to
    assign/unassign adapters, domains and control domains must take and
    release the locks required to perform a dynamic update of a guest's APCB
    in the proper order.
    
    The proper order for taking the locks is:
    
    matrix_dev->guests_lock => kvm->lock => matrix_dev->mdevs_lock
    
    The proper order for releasing the locks is:
    
    matrix_dev->mdevs_lock => kvm->lock => matrix_dev->guests_lock
    
    Two new macros are introduced for this purpose: One to take the locks and
    the other to release the locks. These macros will be used by the
    assignment/unassignment functions to prepare for dynamic update of
    the KVM guest's APCB.
    Signed-off-by: default avatarTony Krowiak <akrowiak@linux.ibm.com>
    Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
    8ee13ad9
vfio_ap_ops.c 48.4 KB