Statistics
| Branch: | Revision:

root / hw / vfio_pci.c @ a1bc20df

History | View | Annotate | Download (57.3 kB)

# Date Author Comment
a8170e5e 10/23/2012 04:58 pm Avi Kivity

Rename target_phys_addr_t to hwaddr

target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
reserved) and its purpose doesn't match the name (most target_phys_addr_t
addresses are not target specific). Replace it with a finger-friendly,...

248bbe74 10/22/2012 10:48 pm Anthony Liguori

Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-20121017.0' into staging

  • awilliam/tags/vfio-pci-for-qemu-20121017.0:
    vfio-pci: Mark non-migratable
    vfio-pci: Fix debug build
f6790af6 10/22/2012 03:50 pm Avi Kivity

memory: use AddressSpace for MemoryListener filtering

Using the AddressSpace type reduces confusion, as you can't accidentally
supply the MemoryRegion you're interested in.

Reviewed-by: Anthony Liguori <>
Signed-off-by: Avi Kivity <>

d9f0e638 10/17/2012 08:20 pm Alex Williamson

vfio-pci: Mark non-migratable

We haven't magically fixed this yet. Toss in a description too.

Signed-off-by: Alex Williamson <>

a011b10e 10/17/2012 08:20 pm Alex Williamson

vfio-pci: Fix debug build

Stray variable from before MSI-X rework

Signed-off-by: Alex Williamson <>

e71e602c 10/15/2012 12:43 pm Avi Kivity

vfio: drop no-op MemoryListener callbacks

Removes quite a bit of useless code.

Signed-off-by: Avi Kivity <>

1a403133 10/08/2012 05:45 pm Alex Williamson

vfio-pci: Clang cleanup

Blue Swirl reports that Clang doesn't like the structure we define to
avoid dynamic allocation for a number of calls to VFIO_DEVICE_SET_IRQS.
Adding an element after a variable sized type is a GNU extension.
Switch back to dynamic allocation, which really isn't a problem since...

3a4f2816 10/08/2012 05:45 pm Jan Kiszka

vfio-pci: Fix BAR->VFIODevice translation in

DO_UPCAST is supposed to translate from the first member of a struct to
that struct, not from arbitrary ones. And it (usually) breaks the build
when neglecting this rule. Use container_of to fix the build breakage...

5c97e5eb 10/08/2012 05:45 pm Alex Williamson

vfio-pci: Roll the header into the .c file

It's only ~100 lines and nobody else should be using this.
Suggested by Michael Tsirkin.

Signed-off-by: Alex Williamson <>

e43b9a5a 10/08/2012 05:45 pm Alex Williamson

vfio-pci: Don't peak at msi_supported

Let the init function fail, just don't warn for -ENOTSUP.

Signed-off-by: Alex Williamson <>

5976cdd5 10/08/2012 05:45 pm Alex Williamson

vfio-pci: Use uintptr_t for void* cast

We don't seem to run into any sign extension problems, but
unsigned looks more correct.

Signed-off-by: Alex williamson <>

9b1e45c8 10/08/2012 05:45 pm Alex Williamson

vfio-pci: Remove setting of MSI qsize

This was a misinterpretation of the spec, hardware doesn't get to
specify how many were actually enabled through this field.

Signed-off-by: Alex Williamson <>

5834a83f 10/08/2012 05:45 pm Alex Williamson

vfio-pci: Extend reset

Take what we've learned from pci-assign and apply it to vfio-pci.
On reset, disable previous interrupt config, perform a device
reset if available, re-enable INTx, and disable memory regions on
the device to prevent continuing DMA....

ce59af2d 10/08/2012 05:45 pm Alex Williamson

vfio-pci: Cleanup on INTx setup failure

Missing some unwind code.

Signed-off-by: Alex Williamson <>

ea486926 10/08/2012 05:45 pm Alex Williamson

vfio-pci: Update slow path INTx algorithm

We can't afford the overhead of switching out and back into mmap mode
around each interrupt, but we can do it lazily via a timer. On INTx
interrupt, disable the mmap'd memory regions and set a timer. On
every interrupt, push the timer out. If the timer expires and the...

af6bc27e 10/08/2012 05:45 pm Alex Williamson

vfio-pci: Re-order map/unmap

This cleans up the next patch that calls unmap from map.

Signed-off-by: Alex Williamson <>

12af1344 10/08/2012 05:45 pm Alex Williamson

vfio-pci: Unmap and retry DMA mapping

Occasionally we get regions added that overlap with existing mappings.
These always seems to be in the VGA ROM range. VFIO returns EBUSY
for these mapping attempts. We can try a little harder and assume
that the latest mapping is correct by removing any overlapping ranges...

fd704adc 10/08/2012 05:45 pm Alex Williamson

vfio-pci: Rework MSIX setup/teardown

We try to do lazy initialization of MSIX since we don't actually need
to setup anything until MSIX vectors start getting used. This leads
to problems if MSIX is enabled, but never used (we can end up trying
to re-enable INTx while it's still enabled). We also run into...

98cd5a5e 10/08/2012 05:45 pm Alex Williamson

vfio-pci: No spurious MSIs

FreeBSD doesn't like these spurious MSIs, remove them as they're
mostly paranoia anyway.

Signed-off-by: Alex Williamson <>

0f41dc18 10/01/2012 09:40 pm Anthony Liguori

vfio_pci: fix build on 32-bit systems

We cannot cast directly from pointer to uint64.

Cc: Alex Williamson <>
Cc: Alex Barcelo <>
Reported-by: Alex Barcelo <>
Signed-off-by: Anthony Liguori <>

65501a74 10/01/2012 04:04 pm Alex Williamson

vfio: vfio-pci device assignment driver

This adds the core of the QEMU VFIO-based PCI device assignment driver.
To make use of this driver, enable CONFIG_VFIO, CONFIG_VFIO_IOMMU_TYPE1,
and CONFIG_VFIO_PCI in your host Linux kernel config. Load the vfio-pci...