From: Anthony Liguori <aliguori@us.ibm.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: rusty@rustcorp.com.au, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] virtio: Add PCI memory BAR in addition to PIO BAR
Date: Tue, 01 Nov 2011 17:20:06 -0500 [thread overview]
Message-ID: <4EB07096.4070806@us.ibm.com> (raw)
In-Reply-To: <1317360376-12090-1-git-send-email-david@gibson.dropbear.id.au>
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<david@gibson.dropbear.id.au>
Seems harmless for QEMU, so applied. You should update the virtio-pci spec too.
Regards,
Anthony Liguori
> ---
> hw/virtio-pci.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
> index df27c19..68cd5bc 100644
> --- a/hw/virtio-pci.c
> +++ b/hw/virtio-pci.c
> @@ -659,6 +659,8 @@ void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev)
> "virtio-pci", size);
> pci_register_bar(&proxy->pci_dev, 0, PCI_BASE_ADDRESS_SPACE_IO,
> &proxy->bar);
> + pci_register_bar(&proxy->pci_dev, 2, PCI_BASE_ADDRESS_SPACE_MEMORY,
> +&proxy->bar);
>
> if (!kvm_has_many_ioeventfds()) {
> proxy->flags&= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD;
next prev parent reply other threads:[~2011-11-01 22:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-30 5:26 [Qemu-devel] [PATCH] virtio: Add PCI memory BAR in addition to PIO BAR David Gibson
2011-11-01 22:20 ` Anthony Liguori [this message]
2011-11-02 0:16 ` David Gibson
2011-11-02 0:32 ` Anthony Liguori
2011-11-02 3:22 ` Rusty Russell
2011-11-02 12:39 ` Anthony Liguori
2011-11-02 21:51 ` Michael S. Tsirkin
2011-11-03 10:36 ` Avi Kivity
2011-11-03 13:07 ` Anthony Liguori
2011-11-03 13:13 ` Avi Kivity
2011-11-03 13:38 ` Anthony Liguori
2011-11-03 13:45 ` Avi Kivity
2011-11-03 13:49 ` Anthony Liguori
2011-11-03 14:31 ` Michael S. Tsirkin
2011-11-03 14:37 ` Anthony Liguori
2011-11-03 14:53 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EB07096.4070806@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).