From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SA1zC-00075U-3Y for qemu-devel@nongnu.org; Tue, 20 Mar 2012 12:32:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SA1z7-0007vV-A1 for qemu-devel@nongnu.org; Tue, 20 Mar 2012 12:32:37 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:45512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SA1z7-0007vN-4B for qemu-devel@nongnu.org; Tue, 20 Mar 2012 12:32:33 -0400 From: Paul Brook Date: Tue, 20 Mar 2012 16:32:23 +0000 References: <20120319203721.GA9399@redhat.com> In-Reply-To: <20120319203721.GA9399@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201203201632.23939.paul@codesourcery.com> Subject: Re: [Qemu-devel] [PATCHv2] virtio-pci: add MMIO property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , kvm@vger.kernel.org, "Michael S. Tsirkin" , Alexey Kardashevskiy , rusty@rustcorp.com.au, virtualization@lists.linux-foundation.org, avi@redhat.com > @@ -682,10 +733,18 @@ void virtio_init_pci(VirtIOPCIProxy *proxy, > VirtIODevice *vdev) if (size & (size-1)) > size = 1 << qemu_fls(size); > > + proxy->bar0_mask = size - 1; You'll get better performance if you use page-sized mappings. You're already creating a mapping bigger than the actual data (rounding up to power-of-two), so you may as well pick a value that's convenient for qemu to map into the address space. Paul