提交 7e60946f 编写于 作者: X Xiong Zhang 提交者: Zhenyu Wang

drm/i915/gvt: Release gvt->lock at the failure of finding page track

page_track_handler take lock at the beginning, the lock should be released
at the failure of finding page track. Otherwise deadlock will happen.

Fixes: e502a2af ("drm/i915/gvt: Provide generic page_track infrastructure for write-protected page")
Signed-off-by: NXiong Zhang <xiong.y.zhang@intel.com>
Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
上级 6846dfeb
...@@ -165,7 +165,7 @@ int intel_vgpu_page_track_handler(struct intel_vgpu *vgpu, u64 gpa, ...@@ -165,7 +165,7 @@ int intel_vgpu_page_track_handler(struct intel_vgpu *vgpu, u64 gpa,
page_track = intel_vgpu_find_page_track(vgpu, gpa >> PAGE_SHIFT); page_track = intel_vgpu_find_page_track(vgpu, gpa >> PAGE_SHIFT);
if (!page_track) if (!page_track)
return 0; goto out;
if (unlikely(vgpu->failsafe)) { if (unlikely(vgpu->failsafe)) {
/* Remove write protection to prevent furture traps. */ /* Remove write protection to prevent furture traps. */
...@@ -176,6 +176,7 @@ int intel_vgpu_page_track_handler(struct intel_vgpu *vgpu, u64 gpa, ...@@ -176,6 +176,7 @@ int intel_vgpu_page_track_handler(struct intel_vgpu *vgpu, u64 gpa,
gvt_err("guest page write error, gpa %llx\n", gpa); gvt_err("guest page write error, gpa %llx\n", gpa);
} }
out:
mutex_unlock(&gvt->lock); mutex_unlock(&gvt->lock);
return ret; return ret;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册