hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/gpu/drm/i915/gvt/hypercall.h
....@@ -33,15 +33,25 @@
3333 #ifndef _GVT_HYPERCALL_H_
3434 #define _GVT_HYPERCALL_H_
3535
36
+#include <linux/types.h>
37
+
38
+struct device;
39
+
40
+enum hypervisor_type {
41
+ INTEL_GVT_HYPERVISOR_XEN = 0,
42
+ INTEL_GVT_HYPERVISOR_KVM,
43
+};
44
+
3645 /*
3746 * Specific GVT-g MPT modules function collections. Currently GVT-g supports
3847 * both Xen and KVM by providing dedicated hypervisor-related MPT modules.
3948 */
4049 struct intel_gvt_mpt {
50
+ enum hypervisor_type type;
4151 int (*host_init)(struct device *dev, void *gvt, const void *ops);
42
- void (*host_exit)(struct device *dev, void *gvt);
52
+ void (*host_exit)(struct device *dev);
4353 int (*attach_vgpu)(void *vgpu, unsigned long *handle);
44
- void (*detach_vgpu)(unsigned long handle);
54
+ void (*detach_vgpu)(void *vgpu);
4555 int (*inject_msi)(unsigned long handle, u32 addr, u16 data);
4656 unsigned long (*from_virt_to_mfn)(void *p);
4757 int (*enable_page_track)(unsigned long handle, u64 gfn);
....@@ -56,17 +66,17 @@
5666 unsigned long size, dma_addr_t *dma_addr);
5767 void (*dma_unmap_guest_page)(unsigned long handle, dma_addr_t dma_addr);
5868
69
+ int (*dma_pin_guest_page)(unsigned long handle, dma_addr_t dma_addr);
70
+
5971 int (*map_gfn_to_mfn)(unsigned long handle, unsigned long gfn,
6072 unsigned long mfn, unsigned int nr, bool map);
6173 int (*set_trap_area)(unsigned long handle, u64 start, u64 end,
6274 bool map);
6375 int (*set_opregion)(void *vgpu);
76
+ int (*set_edid)(void *vgpu, int port_num);
6477 int (*get_vfio_device)(void *vgpu);
6578 void (*put_vfio_device)(void *vgpu);
6679 bool (*is_valid_gfn)(unsigned long handle, unsigned long gfn);
6780 };
68
-
69
-extern struct intel_gvt_mpt xengt_mpt;
70
-extern struct intel_gvt_mpt kvmgt_mpt;
7181
7282 #endif /* _GVT_HYPERCALL_H_ */