[PATCH] dm: not register/unregister gvt bar memory


Xinyun Liu
 

For AcrnGT, the memory access is trapped in sos kernel and acrngt driver
intercepts it. So no need to register the memory block in acrn-dm when
allocate the virtual bar.

v2: removed unnessary braces and use printf to log

Tracked-On: #2976
Signed-off-by: Liu Xinyun <xinyun.liu@...>
---
devicemodel/hw/pci/core.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/devicemodel/hw/pci/core.c b/devicemodel/hw/pci/core.c
index ce35230d..35d9c901 100644
--- a/devicemodel/hw/pci/core.c
+++ b/devicemodel/hw/pci/core.c
@@ -127,6 +127,15 @@ CFGREAD(struct pci_vdev *dev, int coff, int bytes)
return pci_get_cfgdata32(dev, coff);
}

+static inline int
+is_pci_gvt(struct pci_vdev *dev)
+{
+ if (dev == NULL || strncmp(dev->dev_ops->class_name, "pci-gvt",7))
+ return 0;
+ else
+ return 1;
+}
+
/*
* I/O access
*/
@@ -493,6 +502,10 @@ modify_bar_registration(struct pci_vdev *dev, int idx, int registration)
struct inout_port iop;
struct mem_range mr;

+ if (is_pci_gvt(dev)) {
+ printf("modify_bar_registration: bypass for pci-gvt\n");
+ return;
+ }
switch (dev->bar[idx].type) {
case PCIBAR_IO:
bzero(&iop, sizeof(struct inout_port));
--
2.17.1

Join acrn-dev@lists.projectacrn.org to automatically receive all group messages.