Skip to content

RFC QEMU: Dynamic trap/untrap of VFIO PCI BARs

Yan Zhao qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2hw/vfio: add a 'disablable' flag to sparse mmaped regionhw/vfio/common.c hw/vfio/trace-events include/hw/vfio/vfio-common.h +1 more+33 -20 replies
2/2hw/vfio/pci: init dynamic-trap-bar-info regionhw/vfio/pci.c hw/vfio/pci.h hw/vfio/trace-events +1 more+134 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/2] QEMU: Dynamic trap/untrap of VFIO PCI BARs

This patchset enables PCI BARs to be dynamically trapped/passthroughed in response to vendor driver's needs.

To dynamic trap/untrap PCI BARs, 3 info required:
(1) which part of PCI BARs are to be trapped/passthroughed
(2) when to do the trap/passthrough transition
(3) to trap or to passthrough

Patch 1 let vendor driver specify which sparse mmaped subregions are disablable. Therefore providing the first info.

Patch 2 probes and creates dynamic trap bar info region, whose "dt_fd" field provides the second info, and
"trap" field provide the third info.

The corresponding kernel implementation is at
https://www.spinics.net/lists/kernel/msg3337337.html.

Yan Zhao (2):
hw/vfio: add a 'disablable' flag to sparse mmaped region hw/vfio/pci: init dynamic-trap-bar-info region

 hw/vfio/common.c              |  28 +++++++-
 hw/vfio/pci.c                 | 117 ++++++++++++++++++++++++++++++++++
 hw/vfio/pci.h                 |   5 ++
 hw/vfio/trace-events          |   4 +-
 include/hw/vfio/vfio-common.h |   2 +
 linux-headers/linux/vfio.h    |  13 ++++
 6 files changed, 167 insertions(+), 2 deletions(-)
Signature · 1 line
2.17.1