Hi, > Looking at the current hw/virtio/virtio-pci.c in qemu: it seems to react > to only the PCI_COMMAND_MASTER bit of PCI_COMMAND anyway. Does it > actually make any difference to qemu if we set both the IO and MEM bits?
It does, but that happens in the generic pci code as it is the same for all pci devices. With IO not set the io region for the pci io bar is not enabled, and qemu can skip the region when searching for a io handler after trapping an io instruction. So, in general it is a good idea to leave stuff disabled if you don't need it as this saves resources. Some cpu cycles in emulation code in case of qemu, and possibly it reduces power consumption a bit on physical hardware. But not doing so should not cause big problems either, especially in case the software runs for a short amount of time only like ipxe does. For reference: seabios recently started doing that too with this commit: https://code.coreboot.org/p/seabios/source/commit/f1b1d76159a8e7091e783bbc296b928226ccf153/ ... and switching all drivers over to use the new pci_enable_{io,mem}bar functions in subsequent patches. cheers, Gerd _______________________________________________ ipxe-devel mailing list ipxe-devel@lists.ipxe.org https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel