summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/vfio.c
diff options
context:
space:
mode:
authorYongji Xie <xyjxie@linux.vnet.ibm.com>2016-06-30 15:21:24 +0800
committerAlex Williamson <alex.williamson@redhat.com>2016-07-08 10:06:04 -0600
commit05f0c03fbac1819e86c9d5db4e208b68fc1b9b5e (patch)
tree9bd1c755a90f8f2cc6d34b7e191f3b6b92207a49 /drivers/vfio/vfio.c
parent9698cbf0bea6b9f5c3190ce97bdf8963c0148671 (diff)
downloadlinux-05f0c03fbac1819e86c9d5db4e208b68fc1b9b5e.tar.bz2
vfio-pci: Allow to mmap sub-page MMIO BARs if the mmio page is exclusive
Current vfio-pci implementation disallows to mmap sub-page(size < PAGE_SIZE) MMIO BARs because these BARs' mmio page may be shared with other BARs. This will cause some performance issues when we passthrough a PCI device with this kind of BARs. Guest will be not able to handle the mmio accesses to the BARs which leads to mmio emulations in host. However, not all sub-page BARs will share page with other BARs. We should allow to mmap the sub-page MMIO BARs which we can make sure will not share page with other BARs. This patch adds support for this case. And we try to add a dummy resource to reserve the remainder of the page which hot-add device's BAR might be assigned into. But it's not necessary to handle the case when the BAR is not page aligned. Because we can't expect the BAR will be assigned into the same location in a page in guest when we passthrough the BAR. And it's hard to access this BAR in userspace because we have no way to get the BAR's location in a page. Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/vfio.c')
0 files changed, 0 insertions, 0 deletions