]> git.karo-electronics.de Git - karo-tx-linux.git/commit
virtio-pci: Use PCI MMIO instead of PIO when available
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 12 Oct 2011 03:39:06 +0000 (14:39 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 1 Nov 2011 00:15:27 +0000 (11:15 +1100)
commit20a5558666ad9d8bf4310872fdb4313856d63fc7
treef50b42dd71b04ef9e1bcef07877c3549f59d2ab3
parent76e50f1bd51c79382692913eb880d8602e06324f
virtio-pci: Use PCI MMIO instead of PIO when available

Currently virtio-pci is specced so that configuration of the device is
done through a PCI IO space (via BAR 0 of the virtual PCI device).
However, use of PCI IO space (aka PIO) is long deprecated, and can be
awkward to use on some systems (for example IBM pSeries machines
typically have many PCI domains, and not all firmware/hypervisor
versions necessarily support PCI PIO access on all domains).

Therefore, it would be preferable for the virtio virtual PCI device to
advertise a PCI memory space (aka MMIO) BAR and have configuration
done through this interface instead.  This can be done backwards
compatibly by advertising the MMIO BAR in addition to the existing PIO
BAR so that the guest driver can choose whichever interface.

In anticipation of adding such an MMIO BAR to virtio host-side
implementations (e.g. qemu), this patch updates the Linux virtio-pci
driver to attempt to use BAR 2 (which will be MMIO) in preference to
the existing PIO BAR 0.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/virtio/virtio_pci.c