[ipxe-devel] [ipxe/ipxe] virtio changes 5/2016 (#55)

Gerd Hoffmann kraxel at redhat.com
Wed Jun 22 09:52:24 UTC 2016


> 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:


... and switching all drivers over to use the new pci_enable_{io,mem}bar
functions in subsequent patches.


More information about the ipxe-devel mailing list