From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLMhg-0002qN-6G for qemu-devel@nongnu.org; Tue, 01 Nov 2011 18:21:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLMhe-0000UZ-VM for qemu-devel@nongnu.org; Tue, 01 Nov 2011 18:21:08 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:48127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLMhe-0000UM-H4 for qemu-devel@nongnu.org; Tue, 01 Nov 2011 18:21:06 -0400 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Nov 2011 16:21:02 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pA1MK7l3233886 for ; Tue, 1 Nov 2011 16:20:07 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pA1MK6ZC030742 for ; Tue, 1 Nov 2011 16:20:07 -0600 Message-ID: <4EB07096.4070806@us.ibm.com> Date: Tue, 01 Nov 2011 17:20:06 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1317360376-12090-1-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1317360376-12090-1-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio: Add PCI memory BAR in addition to PIO BAR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: rusty@rustcorp.com.au, qemu-devel@nongnu.org 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 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;