diff options
author | Matthew Rosato <mjrosato@linux.ibm.com> | 2022-06-06 16:33:21 -0400 |
---|---|---|
committer | Christian Borntraeger <borntraeger@linux.ibm.com> | 2022-07-11 09:54:35 +0200 |
commit | 8061d1c31f1a018281bc9877ecce44bfc779e21d (patch) | |
tree | 364d080e4be0b214fb1d7ea62aa844b9a874aa1e /include/linux/vfio_pci_core.h | |
parent | 09340b2fca007509c3cbc34fdc97961e0abfc589 (diff) | |
download | linux-8061d1c31f1a018281bc9877ecce44bfc779e21d.tar.gz |
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>
Diffstat (limited to 'include/linux/vfio_pci_core.h')
-rw-r--r-- | include/linux/vfio_pci_core.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/vfio_pci_core.h b/include/linux/vfio_pci_core.h index 63af2897939c..d5d9e17f0156 100644 --- a/include/linux/vfio_pci_core.h +++ b/include/linux/vfio_pci_core.h @@ -209,12 +209,22 @@ static inline int vfio_pci_igd_init(struct vfio_pci_core_device *vdev) #ifdef CONFIG_VFIO_PCI_ZDEV_KVM extern int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, struct vfio_info_cap *caps); +int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev); +void vfio_pci_zdev_close_device(struct vfio_pci_core_device *vdev); #else static inline int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, struct vfio_info_cap *caps) { return -ENODEV; } + +static inline int vfio_pci_zdev_open_device(struct vfio_pci_core_device *vdev) +{ + return 0; +} + +static inline void vfio_pci_zdev_close_device(struct vfio_pci_core_device *vdev) +{} #endif /* Will be exported for vfio pci drivers usage */ |