Skip to content

vfio: quirks & tracing refactoring

Alex Williamson qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17vfio/pci: Rename INTx functions for easier tracinghw/vfio/pci.c trace-events+31 -310 replies
2/17vfio/pci: Rename MSI/X functions for easier tracinghw/vfio/pci.c trace-events+40 -450 replies
3/17vfio/pci: Make interrupt bypass runtime configurablehw/vfio/pci.c include/hw/vfio/vfio-common.h+12 -120 replies
4/17vfio: Change polarity of our no-mmap optionhw/vfio/common.c hw/vfio/pci.c hw/vfio/platform.c +1 more+4 -40 replies
5/17vfio/pci: Extract PCI structures to a separate headerhw/vfio/pci.c hw/vfio/pci.h+159 -1430 replies
6/17vfio/pci: Split quirks to a separate filehw/vfio/Makefile.objs hw/vfio/pci-quirks.c hw/vfio/pci.c +1 more+908 -8820 replies
7/17vfio/pci: Cleanup ROM blacklist quirkhw/vfio/pci-quirks.c hw/vfio/pci.h trace-events+28 -200 replies
8/17vfio/pci: Foundation for new quirk structurehw/vfio/pci-quirks.c hw/vfio/pci.h+157 -1040 replies
9/17vfio/pci: Cleanup ATI 0x3c3 quirkhw/vfio/pci-quirks.c trace-events+11 -190 replies
10/17vfio/pci: Cleanup Nvidia 0x3d0 quirkhw/vfio/pci-quirks.c trace-events+111 -680 replies
11/17vfio/pci: Rework RTL8168 quirkhw/vfio/pci-quirks.c trace-events+105 -800 replies
12/17vfio/pci: Config window quirkshw/vfio/pci-quirks.c trace-events+276 -900 replies
13/17vfio/pci: Config mirror quirkhw/vfio/pci-quirks.c trace-events+129 -1100 replies
14/17vfio/pci: Remove old config window and mirror quirkshw/vfio/pci-quirks.c hw/vfio/pci.h trace-events+0 -1860 replies
15/17vfio/pci: Move AMD device specific reset to quirkshw/vfio/pci-quirks.c hw/vfio/pci.c hw/vfio/pci.h +1 more+177 -1570 replies
16/17vfio/pci: Cache vendor and device IDhw/vfio/pci-quirks.c hw/vfio/pci.c hw/vfio/pci.h+11 -190 replies
17/17vfio/pci: Add emulated PCI IDshw/vfio/pci-quirks.c hw/vfio/pci.c hw/vfio/pci.h +1 more+63 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 00/17] vfio: quirks & tracing refactoring

This series aims to do a few things:

- Improve tracing support in vfio, especially the ability to isolate tracing to various features, like INTx, MSI, MSI-X, quirks, specific quirks, etc. There's more to do here, but this is an improvement.

- Split quirks out of the core vfio-pci code. They're too large, they need to be separated.

- Make quirks more maintainable and extensible. In the past, I tried to make a common quirk interface but the commonality was pushed too high resulting in a shared data structure that didn't make sense for most of the users. This version still provides sufficient commonality for shared teardown, but doesn't impose a data struct on memory region ops.

- Make better use of MemoryRegions. We can use more than a single MemoryRegion for each quirk, simplifying the ops callbacks to handle the behavior of only a single register. For instance data and window registers can make use of two MemoryRegions.

- Eliminate target page size dependencies in quirks. Some of these must have been to work around bugs in previous generations of the memory API, some were just for convenience. We don't need to setup quirks on target page boundaries, that's the memory API's problem. We don't need to save bits and assume page alignment in the quirks, we're better off using structure specific to our quirk ops and trimming out unused features.

- Eliminate build-time debugging and tunables. Interrupt setup is slow path, so we're not saving anything by requiring a rebuild to not use the KVM interrupt path. Make these all experimental (aka unsupported) options that are available for debugging and tracing. Also fix the polarity of x-mmap and rename to x-no-mmap. Backend drivers shouldn't need to expose this unless they want the tracing ability and I've seen users specify it because mmap sounds like something they'd want.

Beyond the standard testing I've done, using a variety of devices and configurations that rely on the quirks, I've received testing feed back from several users on the vfio-users mailing list who have reported no regressions. Comments and review welcome. Thanks,

Alex

PS - this series applies on top of 2.4 + "vfio/pci: Cleanup RTL8168
quirk and tracing" + "vfio/pci: Cleanup vfio_early_setup_msix() error path". Both of these are in my local next branch but haven't been pushed for 2.5 yet.

---

Alex Williamson (17):
vfio/pci: Rename INTx functions for easier tracing vfio/pci: Rename MSI/X functions for easier tracing vfio/pci: Make interrupt bypass runtime configurable
vfio: Change polarity of our no-mmap option vfio/pci: Extract PCI structures to a separate header vfio/pci: Split quirks to a separate file vfio/pci: Cleanup ROM blacklist quirk vfio/pci: Foundation for new quirk structure vfio/pci: Cleanup ATI 0x3c3 quirk
vfio/pci: Cleanup Nvidia 0x3d0 quirk vfio/pci: Rework RTL8168 quirk
vfio/pci: Config window quirks
vfio/pci: Config mirror quirk
vfio/pci: Remove old config window and mirror quirks vfio/pci: Move AMD device specific reset to quirks vfio/pci: Cache vendor and device ID vfio/pci: Add emulated PCI IDs

 hw/vfio/Makefile.objs         |    2 
 hw/vfio/common.c              |    2 
 hw/vfio/pci-quirks.c          | 1204 ++++++++++++++++++++++++++++++++++++
 hw/vfio/pci.c                 | 1385 ++++-------------------------------------
 hw/vfio/pci.h                 |  159 +++++
 hw/vfio/platform.c            |    2 
 include/hw/vfio/vfio-common.h |    7 
 trace-events                  |   85 +--
 8 files changed, 1546 insertions(+), 1300 deletions(-)
 create mode 100644 hw/vfio/pci-quirks.c
 create mode 100644 hw/vfio/pci.h