[PATCH] drm/i915/gvt: Refine fence mmio read handler
Zhenyu Wang
zhenyuw at linux.intel.com
Thu Jun 15 08:49:19 UTC 2017
On 2017.06.14 16:03:09 +0800, fred gao wrote:
> 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;
> }
This should be seperate one, and will surely bloat kernel message.
> @@ -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;
> }
>
For special case handling for oob fence to read 0, pls add comment and send
this one alone to apply.
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20170615/ee6df086/attachment.sig>
More information about the intel-gvt-dev
mailing list