|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH 0/4] introduce cpu_physical_memory_map_fast |
Date: | Mon, 06 Jun 2011 17:55:50 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10 |
On 06/06/2011 05:44 PM, Anthony Liguori wrote:
Not just that. If you had a memory block at say 1 GB - 2 GB, and another at 2 GB - 3 GB, a DMA operation that crosses the two could be implemented with cpu_physical_memory_map_fast; you would simply build a two-element iovec in two steps, something the current API does not allow.You cannot assume RAM blocks are contiguous. This has nothing to do with PV or not PV but how the RAM API works today.
That's exactly why I said a *two-element* iovec.
Virtio can handle all of this today because it uses cpu_physical_memory_rw for ring access and then calls map for SG elements. SG elements are usually 4k so it's never really an issue to get a partial mapping. We could be more robust about it but in practice, it's not a problem.
I know in practice it's not a problem, but I dislike not having an API that can deal with it even in theory. For vmw_pvscsi it's like 5 lines of code to allow it.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |