From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Brook Subject: Re: [Qemu-devel] [PATCHv2] virtio-pci: add MMIO property Date: Tue, 20 Mar 2012 16:32:23 +0000 Message-ID: <201203201632.23939.paul@codesourcery.com> References: <20120319203721.GA9399@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: "Michael S. Tsirkin" , Alexey Kardashevskiy , rusty@rustcorp.com.au, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, avi@redhat.com, Anthony Liguori To: qemu-devel@nongnu.org Return-path: Received: from relay1.mentorg.com ([192.94.38.131]:45511 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760335Ab2CTQcb (ORCPT ); Tue, 20 Mar 2012 12:32:31 -0400 In-Reply-To: <20120319203721.GA9399@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: > @@ -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 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