From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAiRW-0005eE-IF for qemu-devel@nongnu.org; Mon, 03 Oct 2011 09:20:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RAiRS-0007KS-No for qemu-devel@nongnu.org; Mon, 03 Oct 2011 09:20:26 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:52519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RAiRS-0007KJ-GV for qemu-devel@nongnu.org; Mon, 03 Oct 2011 09:20:22 -0400 Received: from /spool/local by us.ibm.com with XMail ESMTP for from ; Mon, 3 Oct 2011 07:20:20 -0600 Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p93DH9F7052320 for ; Mon, 3 Oct 2011 07:17:10 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p93DH8aS029279 for ; Mon, 3 Oct 2011 07:17:09 -0600 Message-ID: <4E89B5D1.4080600@us.ibm.com> Date: Mon, 03 Oct 2011 08:17:05 -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> <4E883CF4.6060606@redhat.com> <20111002105238.GE30747@redhat.com> <4E8843DB.1020404@redhat.com> <20111002111700.GF30747@redhat.com> <4E885286.30905@redhat.com> <20111002121426.GK30747@redhat.com> In-Reply-To: <20111002121426.GK30747@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, qemu-devel@nongnu.org, agraf@suse.de, Avi Kivity , eduard.munteanu@linux360.ro, David Gibson , rth@twiddle.net On 10/02/2011 07:14 AM, Michael S. Tsirkin wrote: > On Sun, Oct 02, 2011 at 02:01:10PM +0200, Avi Kivity wrote: >>> Hmm, not entirely virtio specific, some devices use stX macros to do the >>> conversion. E.g. stw_be_phys and stl_le_phys are used in several >>> places. >> >> These are fine - explicit endianness. > > Right. So changing these to e.g. stl_dma and assuming > LE is default seems like a step backwards. We're generalizing too much. In general, the device model doesn't need atomic access functions. That's because device model RAM access is not coherent with CPU RAM access. Virtio is a very, very special case. virtio requires coherent RAM access. What we really ought to do is have a variant of the map API that allows for an invalidation callback. That would allow us to map the ring for longer periods of time and then we could access the memory directly. That would not only solve this problem but also improve overall performance. Regards, Anthony Liguori