commit | e35d46529cd99f29af7525ea7bc9b6b4e6fc5812 | [log] [tgz] |
---|---|---|
author | Haiwei Li <haiwei.li@intel.corp-partner.google.com> | Thu Feb 10 15:39:33 2022 +0800 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Feb 28 21:55:09 2022 +0000 |
tree | 12df70bb1a4d08b98041045ee243d16aa12d717e | |
parent | a79e14bad553d370c846339bbc5b919257b59935 [diff] |
devices: vfio_pci: MMIO BAR allocation for devices on non-root buses Since we'll be putting all PCI devices on non-root buses behind virtual PCI-E root ports, MMIO BARs in such devices must be inside the forward windows of their root ports. This presents additional requirements for their MMIO BAR allocation: 1. All non-prefetchable BARs must be inside the same 32-bit MMIO window 2. All prefetchable BARs must be inside the same MMIO window, but different than the non-prefetchable MMIO window 3. Both windows must be 1MB-aligned 4. No other PCI devices should occupy MMIO space in these windows Allocate the entire window from the system resource allocator to prevent any space within the window from being used elsewhere. To maximize memory space efficiency, use VfioResourceAllocator for BAR allocation. BUG=b:185084350 TEST=passthrough a vfio-pci device with bus_number > 0 and static connet it behind a pcie root port, then check pcie RP and vfio-pci device function in guest. Change-Id: Ic9865afc48eb3ff9fa475dbcfdf90642b012980c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3166888 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.
crosvm is currently used to run Linux/Android guests on Chrome OS devices.