[PATCH] drm/i915/gvt: Return -EINVAL when cmd parser access shadowed mmio
Zhenyu Wang
zhenyuw at linux.intel.com
Thu May 23 02:52:39 UTC 2019
On 2019.05.22 14:19:52 +0800, Colin Xu wrote:
> cmd_reg_handler() doesn't allow access shadowed mmio but still returns 0.
> Return -EINVAL instead so that caller can handle properly.
>
> Fixes: be1da7070aea ("drm/i915/gvt: vGPU command scanner")
>
> Signed-off-by: Colin Xu <colin.xu at intel.com>
> ---
> drivers/gpu/drm/i915/gvt/cmd_parser.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> index 5cb59c0b4bbe..c50ef205325c 100644
> --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
> +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> @@ -878,7 +878,7 @@ static int cmd_reg_handler(struct parser_exec_state *s,
>
> if (is_shadowed_mmio(offset)) {
> gvt_vgpu_err("found access of shadowed MMIO %x\n", offset);
> - return 0;
> + return -EINVAL;
> }
I'm still a bit confused by meaning of these shadowed mmio, if they're not
allowed for cmd access we should fix that with proper flag, then this extra
check should not be needed?
>
> if (is_mocs_mmio(offset) &&
> --
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20190523/eb96dbd4/attachment.sig>
More information about the intel-gvt-dev
mailing list