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