A hypervisor may want to perform PCI resource allocation (bus numbers, io and mmio ranges) and program the resulting values into the devices itself rather than delegate this to the firmware.
One possible reason for doing so is more control for the hypervisor over assigned ranges. This will also be faster than entering the guest and then trapping on config space accesses.
Introduce a new flag in fw_cfg, "etc/pci-noalloc", to instruct the firmware to skip the resource allocation phase and use whatever is already programmed in the devices.
Signed-off-by: Abhimanyu Saini sainiabr@amazon.de --- src/fw/pciinit.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index 334fd30c..e1c05410 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -1176,8 +1176,13 @@ static void pci_bios_map_devices(struct pci_bus *busses)
static void pci_allocate_resources(void) { + u64 noalloc; struct pci_bus *busses;
+ noalloc = romfile_loadint("etc/pci-noalloc", 0); + if (noalloc) + return; + dprintf(1, "=== PCI new allocation pass #1 ===\n"); busses = malloc_tmp(sizeof(*busses) * (MaxPCIBus + 1)); if (!busses) {