From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAJIS-0002Ap-EI for qemu-devel@nongnu.org; Sun, 02 Oct 2011 06:29:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAJIR-0004Ch-Aa for qemu-devel@nongnu.org; Sun, 02 Oct 2011 06:29:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAJIR-0004Bi-3G for qemu-devel@nongnu.org; Sun, 02 Oct 2011 06:29:23 -0400 Message-ID: <4E883CF4.6060606@redhat.com> Date: Sun, 02 Oct 2011 12:29:08 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1315197304-22469-1-git-send-email-david@gibson.dropbear.id.au> <1315197304-22469-2-git-send-email-david@gibson.dropbear.id.au> <20111002102547.GC30747@redhat.com> In-Reply-To: <20111002102547.GC30747@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: aliguori@us.ibm.com, joerg.roedel@amd.com, qemu-devel@nongnu.org, agraf@suse.de, kraxel@redhat.com, eduard.munteanu@linux360.ro, David Gibson , rth@twiddle.net On 10/02/2011 12:25 PM, Michael S. Tsirkin wrote: > On Mon, Sep 05, 2011 at 02:34:56PM +1000, David Gibson wrote: > > This patch adds functions to pci.[ch] to perform PCI DMA operations. At > > present, these are just stubs which perform directly cpu physical memory > > accesses. > > > > Using these stubs, however, distinguishes PCI device DMA transactions from > > other accesses to physical memory, which will allow PCI IOMMU support to > > be added in one place, rather than updating every PCI driver at that time. > > > > That is, it allows us to update individual PCI drivers to support an IOMMU > > without having yet determined the details of how the IOMMU emulation will > > operate. This will let us remove the most bitrot-sensitive part of an > > IOMMU patch in advance. > > > > Signed-off-by: David Gibson > > So something I just thought about: > > all wrappers now go through cpu_physical_memory_rw. > This is a problem as e.g. virtio assumes that > accesses such as stw are atomic. cpu_physical_memory_rw > is a memcpy which makes no such guarantees. > Let's change cpu_physical_memory_rw() to provide that guarantee for aligned two and four byte accesses. Having separate paths just for that is not maintainable. -- error compiling committee.c: too many arguments to function