Message ID | 1589470709-4104-1-git-send-email-alexandru.elisei@arm.com (mailing list archive) |
---|---|
Headers | show |
Series | Add reassignable BARs | expand |
On 14/05/2020 16:38, Alexandru Elisei wrote: Hi Will, > kvmtool uses the Linux-only dt property 'linux,pci-probe-only' to prevent > it from trying to reassign the BARs. Let's make the BARs reassignable so we > can get rid of this band-aid. I have covered this series now, posting Reviewed-by: tags for the patches that were still missing it. From my point of view this is good to go now. There is still work to do, but this needs to happen on top of this anyway. Thanks! Andre.
On Thu, 14 May 2020 16:38:17 +0100, Alexandru Elisei wrote: > kvmtool uses the Linux-only dt property 'linux,pci-probe-only' to prevent > it from trying to reassign the BARs. Let's make the BARs reassignable so we > can get rid of this band-aid. > > During device configuration, Linux can assign a region resource to a BAR > that temporarily overlaps with another device. This means that the code > that emulates BAR reassignment must be aware of all the registered PCI > devices. Because of this, and to avoid re-implementing the same code for > each emulated device, the algorithm for activating/deactivating emulation > as BAR addresses change lives completely inside the PCI code. Each device > registers two callback functions which are called when device emulation is > activated (for example, to activate emulation for a newly assigned BAR > address), respectively, when device emulation is deactivated (a previous > BAR address is changed, and emulation for that region must be deactivated). > > [...] Applied to kvmtool (master), thanks! [01/12] ioport: mmio: Use a mutex and reference counting for locking https://git.kernel.org/will/kvmtool/c/09577ac58fef [02/12] pci: Add helpers for BAR values and memory/IO space access https://git.kernel.org/will/kvmtool/c/2f6384f924d7 [03/12] virtio/pci: Get emulated region address from BARs https://git.kernel.org/will/kvmtool/c/e539f3e425fb [04/12] vfio: Reserve ioports when configuring the BAR https://git.kernel.org/will/kvmtool/c/a05e576f7fd8 [05/12] pci: Limit configuration transaction size to 32 bits https://git.kernel.org/will/kvmtool/c/6ea32ebdb84b [06/12] vfio/pci: Don't write configuration value twice https://git.kernel.org/will/kvmtool/c/e1d0285c89ae [07/12] Don't allow more than one framebuffers https://git.kernel.org/will/kvmtool/c/cbf3d16fccba [08/12] pci: Implement callbacks for toggling BAR emulation https://git.kernel.org/will/kvmtool/c/5a8e4f25dd7b [09/12] pci: Toggle BAR I/O and memory space emulation https://git.kernel.org/will/kvmtool/c/46e04130d264 [10/12] pci: Implement reassignable BARs https://git.kernel.org/will/kvmtool/c/465edc9d0fab [11/12] arm/fdt: Remove 'linux,pci-probe-only' property https://git.kernel.org/will/kvmtool/c/ad5e9056de0c [12/12] vfio: Trap MMIO access to BAR addresses which aren't page aligned https://git.kernel.org/will/kvmtool/c/b4fc4f605fc6 Cheers,