[PATCH] drm/i915/gvt: Refine fence mmio read handler

Dong, Chuanxiao chuanxiao.dong at intel.com
Thu Jun 15 09:12:22 UTC 2017



> -----Original Message-----
> From: intel-gvt-dev [mailto:intel-gvt-dev-bounces at lists.freedesktop.org] On
> Behalf Of Zhenyu Wang
> Sent: Thursday, June 15, 2017 4:49 PM
> To: Gao, Fred <fred.gao at intel.com>
> Cc: Zhang, Yulei <yulei.zhang at intel.com>; intel-gvt-
> dev at lists.freedesktop.org
> Subject: Re: [PATCH] drm/i915/gvt: Refine fence mmio read handler
> 
> 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.

One question, if the guest is trying to access some fence registers which are beyond the fence resource GVT allocated to VGPU, can we say this is a guest driver issue?

Thanks
Chuanxiao

> 
> --
> Open Source Technology Center, Intel ltd.
> 
> $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


More information about the intel-gvt-dev mailing list