drm/i915/gvt: scan VM ctx pages
authorYan Zhao <yan.y.zhao@intel.com>
Wed, 23 Dec 2020 03:45:00 +0000 (11:45 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Fri, 25 Dec 2020 03:15:15 +0000 (11:15 +0800)
commit3c4f2120d890b53855366c2e53ebe20806ed0cad
treea816fdc0d3e087588851abdb94fcaa039c2e73e9
parent493f30cd086e5250e77f1ff201d22872a46e83e4
drm/i915/gvt: scan VM ctx pages

Logical Context is actually a big batch buffer consisting of multiple
LRI commands + saved registers. It comprises Ring Context (the first
0x50 dwords) and Engine Context. The registers defined in Engine Context
are command accessible, and safe to execute in VM Context.
This patch
1. stops copy Ring Context and only copys Engine Context from VM Context
2. audits VM Engine Contexts to disallow undesired LRIs
(if accessing registers out of Engine Context that hardware generates).

Cc: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Wang Zhi <zhi.a.wang@intel.com>
Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20201223034500.16983-1-yan.y.zhao@intel.com
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/cmd_parser.c
drivers/gpu/drm/i915/gvt/cmd_parser.h
drivers/gpu/drm/i915/gvt/reg.h
drivers/gpu/drm/i915/gvt/scheduler.c