]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gvt: Fix mmap range check
authorZhenyu Wang <zhenyuw@linux.intel.com>
Fri, 11 Jan 2019 05:58:53 +0000 (13:58 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Tue, 15 Jan 2019 11:04:45 +0000 (19:04 +0800)
commit3bfd25825b04969cdbfc53a384bcd4abca6f5ef3
tree5f736e96c7537172f394b5ea0a5dfca7b629e19f
parenta4a5f7bc35c5e89a3ae42ff846f13ae84e7cbe6a
drm/i915/gvt: Fix mmap range check

This is to fix missed mmap range check on vGPU bar2 region
and only allow to map vGPU allocated GMADDR range, which means
user space should support sparse mmap to get proper offset for
mmap vGPU aperture. And this takes care of actual pgoff in mmap
request as original code always does from beginning of vGPU
aperture.

Fixes: b5a3643943c1 ("drm/i915/gvt/kvmgt: add vfio/mdev support to KVMGT")
Cc: "Monroy, Rodrigo Axel" <rodrigo.axel.monroy@intel.com>
Cc: "Orrala Contreras, Alfredo" <alfredo.orrala.contreras@intel.com>
Cc: stable@vger.kernel.org # v4.10+
Reviewed-by: Hang Yuan <hang.yuan@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/kvmgt.c