Skip to content

Commit

Permalink
Merge tag 'gvt-fixes-2022-11-11' of https://github.com/intel/gvt-linux
Browse files Browse the repository at this point in the history
…into drm-intel-fixes

gvt-fixes-2022-11-11

- kvm reference fix from Sean

Signed-off-by: Tvrtko Ursulin <[email protected]>
From: Zhenyu Wang <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
tursulin committed Nov 22, 2022
2 parents ebbaa43 + 3c9fd44 commit 14af5d3
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 14af5d3

Please sign in to comment.