Re: [ANNOUNCE] kvm-14 release

Anthony Liguori
2007-02-22T18:12:17Z

Avi Kivity wrote:
> Anthony Liguori wrote:
>> Avi Kivity wrote:
>>> Laurent Vivier wrote:
>>>> There are remaining issues : libposix-aio uses kernel AIO, so files
>>>> must be
>>>> opened using O_DIRECT and buffers must be aligned. libposix-aio is
>>>> able to
>>>> manage other cases but this has a performance cost.
>>>>
>>>>
>>>
>>> Because the guest is also doing dma, the buffers are expected to be
>>> aligned (it might be different if using pio, but unlikely).
>>
>> The IDE emulation always uses a temporary buffer. This is partially
>> because you cannot always rely on being able to use an offset on
>> phys_ram_base (when doing user only emulation).
>
> Why is that?

Well, user won't do IDE emulation, but cpu_physical_memory_rw has to
jump through more hoops for IDE.

What's more relevant though, is it's possible for the guest to setup DMA
to device memory, in which case, you need to route the IO to callbacks.
That's pretty unlikely though so I think we can stream line it so that
we maintain correctness while also getting less copies.

Regards,

Anthony Liguori

>
>>
>> We can pretty easily patch this code though to use the DMA address
>> directly instead of the temporary buffer in the non PIO case. We
>> still have to define a raw_pread() that is capable of emulating
>> sector alignment though since Linux will use PIO at first.
>
> Sure. It seems worthwhile for mainline qemu too.