]> 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)
commite96d598d9218bacad092fc89044786cfe020ef01
tree1555f8dff047d95f554858bb35f89e2a77266213
parentfeda7ee0dcf5db552029a92443b9a7d7d6585335
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