1. 31 10月, 2016 6 次提交
    • Y
      vfio: Add support for mmapping sub-page MMIO BARs · 95251725
      Yongji Xie 提交于
      Now the kernel commit 05f0c03fbac1 ("vfio-pci: Allow to mmap
      sub-page MMIO BARs if the mmio page is exclusive") allows VFIO
      to mmap sub-page BARs. This is the corresponding QEMU patch.
      With those patches applied, we could passthrough sub-page BARs
      to guest, which can help to improve IO performance for some devices.
      
      In this patch, we expand MemoryRegions of these sub-page
      MMIO BARs to PAGE_SIZE in vfio_pci_write_config(), so that
      the BARs could be passed to KVM ioctl KVM_SET_USER_MEMORY_REGION
      with a valid size. The expanding size will be recovered when
      the base address of sub-page BAR is changed and not page aligned
      any more in guest. And we also set the priority of these BARs'
      memory regions to zero in case of overlap with BARs which share
      the same page with sub-page BARs in guest.
      Signed-off-by: NYongji Xie <xyjxie@linux.vnet.ibm.com>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      95251725
    • I
      vfio/pci: fix out-of-sync BAR information on reset · a52a4c47
      Ido Yariv 提交于
      When a PCI device is reset, pci_do_device_reset resets all BAR addresses
      in the relevant PCIDevice's config buffer.
      
      The VFIO configuration space stays untouched, so the guest OS may choose
      to skip restoring the BAR addresses as they would seem intact. The PCI
      device may be left non-operational.
      One example of such a scenario is when the guest exits S3.
      
      Fix this by resetting the BAR addresses in the VFIO configuration space
      as well.
      Signed-off-by: NIdo Yariv <ido@wizery.com>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      a52a4c47
    • A
      vfio: Handle zero-length sparse mmap ranges · 24acf72b
      Alex Williamson 提交于
      As reported in the link below, user has a PCI device with a 4KB BAR
      which contains the MSI-X table.  This seems to hit a corner case in
      the kernel where the region reports being mmap capable, but the sparse
      mmap information reports a zero sized range.  It's not entirely clear
      that the kernel is incorrect in doing this, but regardless, we need
      to handle it.  To do this, fill our mmap array only with non-zero
      sized sparse mmap entries and add an error return from the function
      so we can tell the difference between nr_mmaps being zero based on
      sparse mmap info vs lack of sparse mmap info.
      
      NB, this doesn't actually change the behavior of the device, it only
      removes the scary "Failed to mmap ... Performance may be slow" error
      message.  We cannot currently create an mmap over the MSI-X table.
      
      Link: http://lists.nongnu.org/archive/html/qemu-discuss/2016-10/msg00009.htmlSigned-off-by: NAlex Williamson <alex.williamson@redhat.com>
      24acf72b
    • A
      memory: Replace skip_dump flag with "ram_device" · 21e00fa5
      Alex Williamson 提交于
      Setting skip_dump on a MemoryRegion allows us to modify one specific
      code path, but the restriction we're trying to address encompasses
      more than that.  If we have a RAM MemoryRegion backed by a physical
      device, it not only restricts our ability to dump that region, but
      also affects how we should manipulate it.  Here we recognize that
      MemoryRegions do not change to sometimes allow dumps and other times
      not, so we replace setting the skip_dump flag with a new initializer
      so that we know exactly the type of region to which we're applying
      this behavior.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Acked-by: NPaolo Bonzini <pbonzini@redhat.com>
      21e00fa5
    • P
      s390x/pci: Check memory region dispatching callbacks · 88ee13c7
      Pierre Morel 提交于
      The instructions PCI STORE, PCI LOAD and PCI STORE BLOCK
      use calls to memory_region_dispatch_write() and
      memory_region_dispatch_read() but do not test the return value.
      
      Furthermore, the instruction PCI STORE BLOCK sets up a PGM_ADDRESSING
      exception when the operand 3 is not within the designated PCI address
      space instead of a PGM_OPERAND exception.
      
      Let's setup a PGM_OPERAND exception in all of these failure cases.
      Signed-off-by: NPierre Morel <pmorel@linux.vnet.ibm.com>
      Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      88ee13c7
    • Y
      s390x/pci: use generic interface to inject interrupt · 45bbcd35
      Yi Min Zhao 提交于
      Let's use the generic interface to inject adapter interrupts.
      Signed-off-by: NYi Min Zhao <zyimin@linux.vnet.ibm.com>
      Acked-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      45bbcd35
  2. 29 10月, 2016 13 次提交
  3. 28 10月, 2016 21 次提交