lkml.org 
[lkml]   [2020]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH v2 5/9] vfio/pci: let vfio_pci know how many vendor regions are registered
Date
This allows a simpler VFIO_DEVICE_GET_INFO ioctl in vendor driver

Cc: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
---
drivers/vfio/pci/vfio_pci.c | 3 ++-
include/linux/vfio.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 1a08b7cc9246..7530cceaeaa5 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -719,7 +719,8 @@ long vfio_pci_ioctl(void *device_data,
if (vdev->priv->reset_works)
info.flags |= VFIO_DEVICE_FLAGS_RESET;

- info.num_regions = VFIO_PCI_NUM_REGIONS + vdev->num_regions;
+ info.num_regions = VFIO_PCI_NUM_REGIONS + vdev->num_regions +
+ vdev->num_vendor_regions;
info.num_irqs = VFIO_PCI_NUM_IRQS;

return copy_to_user((void __user *)arg, &info, minsz) ?
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index 386d1b19da3d..4bb101ac3fff 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -210,6 +210,7 @@ struct vfio_pci_device_private;
struct vfio_pci_device {
struct pci_dev *pdev;
int num_regions;
+ int num_vendor_regions;
int irq_type;
struct vfio_pci_device_private *priv;
struct vfio_pci_vendor_driver *vendor_driver;
--
2.17.1
\
 
 \ /
  Last update: 2020-01-31 03:22    [W:0.052 / U:21.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site