]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gvt: Add carefully checking in GTT walker paths
authorChangbin Du <changbin.du@intel.com>
Wed, 2 Aug 2017 07:06:37 +0000 (15:06 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Thu, 10 Aug 2017 02:26:09 +0000 (10:26 +0800)
commit96d9f00ec2bad42a68954fb24719fb8b160997ef
tree1555f8dff047d95f554858bb35f89e2a77266213
parent30deb32b4944743fd48b33f5a3de0e6ee9cb984e
drm/i915/gvt: Add carefully checking in GTT walker paths

When debugging the gtt code, found the intel_vgpu_gma_to_gpa() can
translate any given GMA though the GMA is not valid. This because
the GTT ops suppress the possible errors, which may result in an
invalid PT entry is retrieved by upper caller.

This patch changed the prototype of pte ops to propagate status to
callers. Then we make sure the GTT walker stop as early as when
a error is detected to prevent undefined behavior.

Signed-off-by: Changbin Du <changbin.du@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/gtt.c
drivers/gpu/drm/i915/gvt/gtt.h