]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
drm/i915/gvt: Fix aperture read/write emulation when enable x-no-mmap=on
authorChangbin Du <changbin.du@intel.com>
Tue, 11 Jun 2019 08:33:00 +0000 (10:33 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 24 Jun 2019 14:21:33 +0000 (16:21 +0200)
commitd2653a3031266198fcc0c718d6559938a4a329cd
tree8f07b8f9a5731386906d3587fce703cf53ffe58f
parentb06f4c80d7b41e5242b46c40be3f5508f32210b7
drm/i915/gvt: Fix aperture read/write emulation when enable x-no-mmap=on

When add 'x-no-mmap=on' for vfio-pci option, aperture access in guest
is emulated. But the vgpu_aperture_rw() function take wrong offset when
do memcpy, since vgpu->gm.aperture_va is not the base of entire aperture.
This mistake cause GPU command in guest get lost and so the seqno is not
updated in engine HWSP.

This patch fix this, and it also move the emulation code to kvmgt.
Because only vfio need to emulate it. Put aperture rw to MMIO emulation
path breaks assumptions in xengt.

v2: Remove PAGE_ALIGN for size (zhenyu)

CVE-2019-11085

Fixes: f090a00df9ec ("drm/i915/gvt: Add emulation for BAR2 (aperture) with normal file RW approach")
Signed-off-by: Changbin Du <changbin.du@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
(backported from commit d480b28a41a628e356dbacfa1c9f6d05b9baf838)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Timo Aaltonen <tjaalton@ubuntu.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/i915/gvt/cfg_space.c
drivers/gpu/drm/i915/gvt/gvt.h
drivers/gpu/drm/i915/gvt/kvmgt.c
drivers/gpu/drm/i915/gvt/mmio.c