|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [PATCH 1/9] Add stub functions for PCI device models to do PCI DMA |
Date: | Mon, 03 Oct 2011 08:17:05 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |