aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/gvt/gvt.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-04-11 16:13:39 +0200
committerZhi Wang <zhi.a.wang@intel.com>2022-04-21 07:36:56 -0400
commit62980cacc37f58bd054de012d08052dfc4f5fa48 (patch)
tree216624d693850ef1a7bc2e4b6aefa33d936395c3 /drivers/gpu/drm/i915/gvt/gvt.h
parentdrm/i915/gvt: remove the unused from_virt_to_mfn op (diff)
downloadlinux-dev-62980cacc37f58bd054de012d08052dfc4f5fa48.tar.xz
linux-dev-62980cacc37f58bd054de012d08052dfc4f5fa48.zip
drm/i915/gvt: merge struct kvmgt_vdev into struct intel_vgpu
Move towards having only a single structure for the per-VGPU state. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Zhi Wang <zhi.a.wang@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-11-hch@lst.de Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt/gvt.h')
-rw-r--r--drivers/gpu/drm/i915/gvt/gvt.h31
1 files changed, 23 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
index 97150a1297eb..628dd686c03d 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -207,21 +207,36 @@ struct intel_vgpu {
struct dentry *debugfs;
- /* Hypervisor-specific device state. */
- void *vdev;
-
struct list_head dmabuf_obj_list_head;
struct mutex dmabuf_lock;
struct idr object_idr;
struct intel_vgpu_vblank_timer vblank_timer;
u32 scan_nonprivbb;
-};
-static inline void *intel_vgpu_vdev(struct intel_vgpu *vgpu)
-{
- return vgpu->vdev;
-}
+ struct mdev_device *mdev;
+ struct vfio_region *region;
+ int num_regions;
+ struct eventfd_ctx *intx_trigger;
+ struct eventfd_ctx *msi_trigger;
+
+ /*
+ * Two caches are used to avoid mapping duplicated pages (eg.
+ * scratch pages). This help to reduce dma setup overhead.
+ */
+ struct rb_root gfn_cache;
+ struct rb_root dma_addr_cache;
+ unsigned long nr_cache_entries;
+ struct mutex cache_lock;
+
+ struct notifier_block iommu_notifier;
+ struct notifier_block group_notifier;
+ struct kvm *kvm;
+ struct work_struct release_work;
+ atomic_t released;
+ struct vfio_device *vfio_device;
+ struct vfio_group *vfio_group;
+};
/* validating GM healthy status*/
#define vgpu_is_vm_unhealthy(ret_val) \