summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/pci/vfio_pci_private.h
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2016-02-22 16:02:41 -0700
committerAlex Williamson <alex.williamson@redhat.com>2016-02-22 16:10:09 -0700
commit345d710491e2d2c4a9406c1d530adb37cc0429c1 (patch)
treecd53a3b22d0aaaba682fdd71c2b6882da4f86835 /drivers/vfio/pci/vfio_pci_private.h
parent28541d41c9e04cb2ddbf93facd1e376dd5613360 (diff)
downloadlinux-345d710491e2d2c4a9406c1d530adb37cc0429c1.tar.bz2
vfio/pci: Enable virtual register in PCI config space
Typically config space for a device is mapped out into capability specific handlers and unassigned space. The latter allows direct read/write access to config space. Sometimes we know about registers living in this void space and would like an easy way to virtualize them, similar to how BAR registers are managed. To do this, create one more pseudo (fake) PCI capability to be handled as purely virtual space. Reads and writes are serviced entirely from virtual config space. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/pci/vfio_pci_private.h')
-rw-r--r--drivers/vfio/pci/vfio_pci_private.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/vfio/pci/vfio_pci_private.h b/drivers/vfio/pci/vfio_pci_private.h
index 0710bda5ae2c..b1e403235feb 100644
--- a/drivers/vfio/pci/vfio_pci_private.h
+++ b/drivers/vfio/pci/vfio_pci_private.h
@@ -25,6 +25,10 @@
#define VFIO_PCI_INDEX_TO_OFFSET(index) ((u64)(index) << VFIO_PCI_OFFSET_SHIFT)
#define VFIO_PCI_OFFSET_MASK (((u64)(1) << VFIO_PCI_OFFSET_SHIFT) - 1)
+/* Special capability IDs predefined access */
+#define PCI_CAP_ID_INVALID 0xFF /* default raw access */
+#define PCI_CAP_ID_INVALID_VIRT 0xFE /* default virt access */
+
struct vfio_pci_irq_ctx {
struct eventfd_ctx *trigger;
struct virqfd *unmask;