aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiong Zhang <xiong.y.zhang@intel.com>2018-03-05 17:07:28 -0500
committerZhenyu Wang <zhenyuw@linux.intel.com>2018-03-06 01:49:38 -0500
commit991ecefbdd4b81719597d6c406df8d26ef5c1546 (patch)
tree563f68f59a70d5cfdff8ab9c60b636b25594a3db
parent7e60946feb4287111dc61a13ee66ea4295f4f6b4 (diff)
drm/i915/gvt: Return error at the failure of finding page_track
In XenGT, ioreq copy is used to trap mmio write and ppgtt write. Both of them are memory write, ioreq handler couldn't distinguish them. So ioreq handler probe the ppgtt write handler, if it is succuess, this ioreq is ppgtt write, otherwise it is mmio write. So ppgtt write handler should return an error at the failure of finding page track, it is fatal to implement ioreq handler in XenGT. Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
-rw-r--r--drivers/gpu/drm/i915/gvt/page_track.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/page_track.c b/drivers/gpu/drm/i915/gvt/page_track.c
index 2d030545356b..53e2bd79c97d 100644
--- a/drivers/gpu/drm/i915/gvt/page_track.c
+++ b/drivers/gpu/drm/i915/gvt/page_track.c
@@ -164,8 +164,10 @@ int intel_vgpu_page_track_handler(struct intel_vgpu *vgpu, u64 gpa,
164 mutex_lock(&gvt->lock); 164 mutex_lock(&gvt->lock);
165 165
166 page_track = intel_vgpu_find_page_track(vgpu, gpa >> PAGE_SHIFT); 166 page_track = intel_vgpu_find_page_track(vgpu, gpa >> PAGE_SHIFT);
167 if (!page_track) 167 if (!page_track) {
168 ret = -ENXIO;
168 goto out; 169 goto out;
170 }
169 171
170 if (unlikely(vgpu->failsafe)) { 172 if (unlikely(vgpu->failsafe)) {
171 /* Remove write protection to prevent furture traps. */ 173 /* Remove write protection to prevent furture traps. */