]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gvt: Add emulation for BAR2 (aperture) with normal file RW approach
authorChangbin Du <changbin.du@intel.com>
Tue, 15 Aug 2017 05:14:04 +0000 (13:14 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Fri, 8 Sep 2017 06:21:13 +0000 (14:21 +0800)
commit5aa1e41a01045bc2a847a216daa889c613b273b7
tree72a835f98ed37eb6213133e04bbc712fb90f04e3
parent3b142d9d7ed52054a01cd070e481240f818a803e
drm/i915/gvt: Add emulation for BAR2 (aperture) with normal file RW approach

For vfio-pci, if the region support MMAP then it should support both
mmap and normal file access. The user-space is free to choose which is
being used. For qemu, we just need add 'x-no-mmap=on' for vfio-pci
option.

Currently GVTg only support MMAP for BAR2. So GVTg will not work when
user turn on x-no-mmap option.

This patch added file style access for BAR2, aka the GPU aperture. We
map the entire aperture partition of active vGPU to kernel space when
guest driver try to enable PCI Memory Space. Then we redirect the file
RW operation from kvmgt to this mapped area.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=1458032
Signed-off-by: Changbin Du <changbin.du@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.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