From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAiJO-0002Ku-S9 for qemu-devel@nongnu.org; Mon, 03 Oct 2011 09:12:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAiJI-0005UX-9b for qemu-devel@nongnu.org; Mon, 03 Oct 2011 09:12:02 -0400 Received: from e4.ny.us.ibm.com ([32.97.182.144]:37461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAiJI-0005UK-61 for qemu-devel@nongnu.org; Mon, 03 Oct 2011 09:11:56 -0400 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e4.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p93Cll5S026528 for ; Mon, 3 Oct 2011 08:47:47 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p93DBjEf950502 for ; Mon, 3 Oct 2011 09:11:46 -0400 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p93DAxpP005667 for ; Mon, 3 Oct 2011 07:11:00 -0600 Message-ID: <4E89B45E.9020705@us.ibm.com> Date: Mon, 03 Oct 2011 08:10:54 -0500 From: Anthony Liguori 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: kraxel@redhat.com, joerg.roedel@amd.com, agraf@suse.de, qemu-devel@nongnu.org, avi@redhat.com, eduard.munteanu@linux360.ro, David Gibson , rth@twiddle.net On 10/02/2011 05:25 AM, 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. That's why I asked for David to add map/unmap functions to the API. Regards, Anthony Liguori