qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] virtio: Add PCI memory BAR in addition to PIO B


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH] virtio: Add PCI memory BAR in addition to PIO BAR
Date: Wed, 2 Nov 2011 23:51:42 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Nov 02, 2011 at 01:52:55PM +1030, Rusty Russell wrote:
> On Tue, 01 Nov 2011 17:20:06 -0500, Anthony Liguori <address@hidden> wrote:
> > On 09/30/2011 12:26 AM, David Gibson wrote:
> > > Currently, virtio devices are usually presented to the guest as an
> > > emulated PCI device, virtio_pci.  Although the actual IO operations
> > > are done through system memory, the configuration of the virtio device
> > > is done through the one PCI IO space BAR that virtio_pci presents.
> > >
> > > But PCI IO space (aka PIO) is deprecated for modern PCI devices, and
> > > on some systems with many PCI domains accessing PIO space can be
> > > problematic.  For example on the existing PowerVM implementation of
> > > the PAPR spec, PCI PIO access is not supported at all.  We're hoping
> > > that our KVM implementation will support PCI PIO (once we support PCI
> > > at all), but it will probably have some irritating limitations.
> > >
> > > This patch, therefore, extends the virtio_pci device to have a PCI
> > > memory space (MMIO) BAR as well as the IO BAR.  The MMIO BAR contains
> > > exactly the same registers, in exactly the same layout as the existing
> > > PIO BAR.
> > >
> > > Because the PIO BAR is still present, existing guest drivers should
> > > still work fine.  With this change in place, future guest drivers can
> > > check for an MMIO BAR and use that if present (falling back to PIO
> > > when possible to support older qemu versions).
> > >
> > > Signed-off-by: David Gibson<address@hidden>
> > 
> > Seems harmless for QEMU, so applied.  You should update the virtio-pci spec 
> > too.
> > 
> > Regards,
> 
> Can you revert this?  We just reverted the kernel part, figuring we need
> a rethink.
> 
> Thanks,
> Rusty.

By the way, it looks like linux guests already do pci_iomap to get at
the BAR.  And that is supposed to work fine with both
memory and IO. So a very simple solution, without touching linux guests,
would be to allow changing BAR 0 type to memory in QEMU.
It'll break non-linux guests unfortunately, but
maybe that's not an issue for PowerVM?

-- 
MST



reply via email to

[Prev in Thread] Current Thread [Next in Thread]