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(-) -- 2.17.1