These don't seem to be necessary in common header From: Alex Williamson --- drivers/vfio/pci/vfio_pci_private.h | 29 +++++++++++++++++++++++++++++ include/linux/vfio_pci_common.h | 31 ++----------------------------- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_private.h b/drivers/vfio/pci/vfio_pci_private.h index c4976a948aaa..bf1995cf417d 100644 --- a/drivers/vfio/pci/vfio_pci_private.h +++ b/drivers/vfio/pci/vfio_pci_private.h @@ -40,12 +40,41 @@ struct vfio_pci_ioeventfd { int count; }; +struct vfio_pci_irq_ctx { + struct eventfd_ctx *trigger; + struct virqfd *unmask; + struct virqfd *mask; + char *name; + bool masked; + struct irq_bypass_producer producer; +}; + struct vfio_pci_dummy_resource { struct resource resource; int index; struct list_head res_next; }; +struct vfio_pci_reflck { + struct kref kref; + struct mutex lock; +}; + +#define is_intx(vdev) (vdev->irq_type == VFIO_PCI_INTX_IRQ_INDEX) +#define is_msi(vdev) (vdev->irq_type == VFIO_PCI_MSI_IRQ_INDEX) +#define is_msix(vdev) (vdev->irq_type == VFIO_PCI_MSIX_IRQ_INDEX) +#define is_irq_none(vdev) (!(is_intx(vdev) || is_msi(vdev) || is_msix(vdev))) +#define irq_is(vdev, type) (vdev->irq_type == type) + +static inline bool vfio_vga_disabled(struct vfio_pci_device *vdev) +{ +#ifdef CONFIG_VFIO_PCI_VGA + return vdev->disable_vga; +#else + return true; +#endif +} + extern void vfio_pci_intx_mask(struct vfio_pci_device *vdev); extern void vfio_pci_intx_unmask(struct vfio_pci_device *vdev); diff --git a/include/linux/vfio_pci_common.h b/include/linux/vfio_pci_common.h index 439666a8ce7a..fa572d388111 100644 --- a/include/linux/vfio_pci_common.h +++ b/include/linux/vfio_pci_common.h @@ -19,17 +19,10 @@ #ifndef VFIO_PCI_COMMON_H #define VFIO_PCI_COMMON_H -struct vfio_pci_irq_ctx { - struct eventfd_ctx *trigger; - struct virqfd *unmask; - struct virqfd *mask; - char *name; - bool masked; - struct irq_bypass_producer producer; -}; - +struct vfio_pci_irq_ctx; struct vfio_pci_device; struct vfio_pci_region; +struct vfio_pci_reflck; struct vfio_pci_regops { size_t (*rw)(struct vfio_pci_device *vdev, char __user *buf, @@ -53,11 +46,6 @@ struct vfio_pci_region { u32 flags; }; -struct vfio_pci_reflck { - struct kref kref; - struct mutex lock; -}; - struct vfio_pci_device { struct pci_dev *pdev; void __iomem *barmap[PCI_STD_NUM_BARS]; @@ -103,12 +91,6 @@ struct vfio_pci_device { bool disable_idle_d3; }; -#define is_intx(vdev) (vdev->irq_type == VFIO_PCI_INTX_IRQ_INDEX) -#define is_msi(vdev) (vdev->irq_type == VFIO_PCI_MSI_IRQ_INDEX) -#define is_msix(vdev) (vdev->irq_type == VFIO_PCI_MSIX_IRQ_INDEX) -#define is_irq_none(vdev) (!(is_intx(vdev) || is_msi(vdev) || is_msix(vdev))) -#define irq_is(vdev, type) (vdev->irq_type == type) - extern const struct pci_error_handlers vfio_pci_err_handlers; static inline bool vfio_pci_is_vga(struct pci_dev *pdev) @@ -116,15 +98,6 @@ static inline bool vfio_pci_is_vga(struct pci_dev *pdev) return (pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA; } -static inline bool vfio_vga_disabled(struct vfio_pci_device *vdev) -{ -#ifdef CONFIG_VFIO_PCI_VGA - return vdev->disable_vga; -#else - return true; -#endif -} - extern void vfio_pci_refresh_config(struct vfio_pci_device *vdev, bool nointxmask, bool disable_idle_d3);