[PATCH] drm/i915/gvt: Refine fence mmio read handler
fred gao
fred.gao at intel.com
Wed Jun 14 08:03:09 UTC 2017
during the emulation of fence mmio read, once the fence number is
greater than vgpu fence size, it will return error and eventually
trigger xengt_emulation_thread to shutdown the guest.
1. dump the error info once the fence number is out of scope.
2. set read value to zero and no need to return error.
this will fix the issue of Windows guest will be removed automatically
after running forceTDR in Windows guest.
Cc: Zhang Yulei <yulei.zhang at intel.com>
Signed-off-by: fred gao <fred.gao at intel.com>
---
drivers/gpu/drm/i915/gvt/handlers.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
index 1414d7e..2741f04 100644
--- a/drivers/gpu/drm/i915/gvt/handlers.c
+++ b/drivers/gpu/drm/i915/gvt/handlers.c
@@ -177,11 +177,10 @@ static int sanitize_fence_mmio_access(struct intel_vgpu *vgpu,
enter_failsafe_mode(vgpu,
GVT_FAILSAFE_UNSUPPORTED_GUEST);
- if (!vgpu->mmio.disable_warn_untrack) {
- gvt_vgpu_err("found oob fence register access\n");
- gvt_vgpu_err("total fence %d, access fence %d\n",
- vgpu_fence_sz(vgpu), fence_num);
- }
+ gvt_err("found oob fence register access\n");
+ gvt_err("total fence %d, access fence %d\n",
+ vgpu_fence_sz(vgpu), fence_num);
+
memset(p_data, 0, bytes);
return -EINVAL;
}
@@ -195,9 +194,8 @@ static int fence_mmio_read(struct intel_vgpu *vgpu, unsigned int off,
ret = sanitize_fence_mmio_access(vgpu, offset_to_fence_num(off),
p_data, bytes);
- if (ret)
- return ret;
- read_vreg(vgpu, off, p_data, bytes);
+ if (!ret)
+ read_vreg(vgpu, off, p_data, bytes);
return 0;
}
--
2.7.4
More information about the intel-gvt-dev
mailing list