drm/i915/gvt: refine ggtt range validation
authorXiong Zhang <xiong.y.zhang@intel.com>
Mon, 27 May 2019 05:45:50 +0000 (13:45 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Thu, 30 May 2019 03:31:43 +0000 (11:31 +0800)
commit5e0b3f3b27731f660612249b74b520f1bce6c198
tree393b1520dfb99cd38870ba5440682355034496c7
parentcb2808da74f07c0763edfa63f8e397f97c7a87a3
drm/i915/gvt: refine ggtt range validation

The vgpu ggtt range should be in vgpu aperture or hidden range. This
patch enforce begin and end address check and guarantee both of them are
in the valid range.

For size=0, it will regress to vgpu_gmadr_is_valid(), will refine
this usage in a later fix.

Fixes: 2707e4446688 ("drm/i915/gvt: vGPU graphics memory virtualization")
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/gtt.c