vfio-pci/zdev: add open/close device hooks
authorMatthew Rosato <mjrosato@linux.ibm.com>
Mon, 6 Jun 2022 20:33:21 +0000 (16:33 -0400)
committerChristian Borntraeger <borntraeger@linux.ibm.com>
Mon, 11 Jul 2022 07:54:35 +0000 (09:54 +0200)
commit8061d1c31f1a018281bc9877ecce44bfc779e21d
tree364d080e4be0b214fb1d7ea62aa844b9a874aa1e
parent09340b2fca007509c3cbc34fdc97961e0abfc589
vfio-pci/zdev: add open/close device hooks

During vfio-pci open_device, pass the KVM associated with the vfio group
(if one exists).  This is needed in order to pass a special indicator
(GISA) to firmware to allow zPCI interpretation facilities to be used
for only the specific KVM associated with the vfio-pci device.  During
vfio-pci close_device, unregister the notifier.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Link: https://lore.kernel.org/r/20220606203325.110625-18-mjrosato@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
drivers/vfio/pci/vfio_pci_core.c
drivers/vfio/pci/vfio_pci_zdev.c
include/linux/vfio_pci_core.h