Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/gvt-fixes' into gvt-staging
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenyw committed Nov 11, 2022
2 parents 81ddf87 + 3c9fd44 commit 92b9d7a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/gpu/drm/i915/gvt/kvmgt.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,6 @@ static int intel_vgpu_open_device(struct vfio_device *vfio_dev)
return -ESRCH;
}

kvm_get_kvm(vgpu->vfio_device.kvm);

if (__kvmgt_vgpu_exist(vgpu))
return -EEXIST;

Expand All @@ -676,6 +674,7 @@ static int intel_vgpu_open_device(struct vfio_device *vfio_dev)

vgpu->track_node.track_write = kvmgt_page_track_write;
vgpu->track_node.track_flush_slot = kvmgt_page_track_flush_slot;
kvm_get_kvm(vgpu->vfio_device.kvm);
kvm_page_track_register_notifier(vgpu->vfio_device.kvm,
&vgpu->track_node);

Expand Down Expand Up @@ -715,15 +714,14 @@ static void intel_vgpu_close_device(struct vfio_device *vfio_dev)

kvm_page_track_unregister_notifier(vgpu->vfio_device.kvm,
&vgpu->track_node);
kvm_put_kvm(vgpu->vfio_device.kvm);

kvmgt_protect_table_destroy(vgpu);
gvt_cache_destroy(vgpu);

intel_vgpu_release_msi_eventfd_ctx(vgpu);

vgpu->attached = false;

if (vgpu->vfio_device.kvm)
kvm_put_kvm(vgpu->vfio_device.kvm);
}

static u64 intel_vgpu_get_bar_addr(struct intel_vgpu *vgpu, int bar)
Expand Down

0 comments on commit 92b9d7a

Please sign in to comment.