[PATCH] drm/i915/gvt: Change the max length of mmio_reg_rw from 4 to 8

Zhenyu Wang zhenyuw at linux.intel.com
Wed Aug 2 02:56:20 UTC 2017


On 2017.08.02 10:31:01 +0800, Xiong Zhang wrote:
> When linux guest access mmio with __raw_i915_read64 or __raw_i915_write64,
> its length is 8 bytes.
> 
> This fix the linux guest in xengt couldn't boot up as it fail in
> reading pv_info->magic.
> 
> Signed-off-by: Xiong Zhang <xiong.y.zhang at intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/handlers.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
> index 5a5c578..46b6521 100644
> --- a/drivers/gpu/drm/i915/gvt/handlers.c
> +++ b/drivers/gpu/drm/i915/gvt/handlers.c
> @@ -3035,7 +3035,7 @@ int intel_vgpu_mmio_reg_rw(struct intel_vgpu *vgpu, unsigned int offset,
>  	gvt_mmio_func func;
>  	int ret;
>  
> -	if (WARN_ON(bytes > 4))
> +	if (WARN_ON(bytes > 8))
>  		return -EINVAL;
>  

Seems bogus as already checked in outside caller, might simply remove.

btw, current kvmgt always handle 64bit r/w by two 32bits, can optimize
that in one call instead of two.

-- 
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/20170802/0d648d23/attachment.sig>


More information about the intel-gvt-dev mailing list