static inline int intel_gvt_hypervisor_host_init(struct device *dev,
void *gvt, const void *ops)
{
+ /* optional to provide */
+ if (!intel_gvt_host.mpt->host_init)
+ return 0;
+
return intel_gvt_host.mpt->host_init(dev, gvt, ops);
}
static inline void intel_gvt_hypervisor_host_exit(struct device *dev,
void *gvt)
{
+ /* optional to provide */
+ if (!intel_gvt_host.mpt->host_exit)
+ return;
+
intel_gvt_host.mpt->host_exit(dev, gvt);
}
*/
static inline int intel_gvt_hypervisor_attach_vgpu(struct intel_vgpu *vgpu)
{
+ /* optional to provide */
+ if (!intel_gvt_host.mpt->attach_vgpu)
+ return 0;
+
return intel_gvt_host.mpt->attach_vgpu(vgpu, &vgpu->handle);
}
*/
static inline void intel_gvt_hypervisor_detach_vgpu(struct intel_vgpu *vgpu)
{
+ /* optional to provide */
+ if (!intel_gvt_host.mpt->detach_vgpu)
+ return;
+
intel_gvt_host.mpt->detach_vgpu(vgpu->handle);
}
unsigned long mfn, unsigned int nr,
bool map)
{
+ /* a MPT implementation could have MMIO mapped elsewhere */
+ if (!intel_gvt_host.mpt->map_gfn_to_mfn)
+ return 0;
+
return intel_gvt_host.mpt->map_gfn_to_mfn(vgpu->handle, gfn, mfn, nr,
map);
}
static inline int intel_gvt_hypervisor_set_trap_area(
struct intel_vgpu *vgpu, u64 start, u64 end, bool map)
{
+ /* a MPT implementation could have MMIO trapped elsewhere */
+ if (!intel_gvt_host.mpt->set_trap_area)
+ return 0;
+
return intel_gvt_host.mpt->set_trap_area(vgpu->handle, start, end, map);
}