drm/i915/gvt: Fix MI_FLUSH_DW parsing with correct index check
authorZhenyu Wang <zhenyuw@linux.intel.com>
Wed, 20 Feb 2019 08:25:04 +0000 (16:25 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Thu, 21 Feb 2019 04:19:19 +0000 (12:19 +0800)
commit13bcb80b7ee79431fce361e060611134cb19e209
tree7976a71324ee3b3d06281a550dec88a25184eca1
parent0f75551216091223efe1f18295f655aff6415385
drm/i915/gvt: Fix MI_FLUSH_DW parsing with correct index check

When MI_FLUSH_DW post write hw status page in index mode, the index
value is in dword step and turned into address offset in cmd dword1.
As status page size is 4K, so can't exceed that.

This fixed upper bound check in cmd parser code which incorrectly
stopped VM for reason of invalid MI_FLUSH_DW write index.

v2:
- Fix upper bound as 4K page size because index value is address offset.

Fixes: be1da7070aea ("drm/i915/gvt: vGPU command scanner")
Cc: stable@vger.kernel.org # v4.10+
Cc: "Zhao, Yan Y" <yan.y.zhao@intel.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/cmd_parser.c