Hollis Blanchard wrote:
> On Sun, 2008-01-13 at 11:42 +0200, Avi Kivity wrote:
>
>   
>> Do we really need to propagate endianness all the way to the user?  
>> Perhaps libkvm could call the regular mmio functions and do the 
>> transformation itself.
>>
>> Or maybe even the kernel can do this by itself?
>>     
>
> The kernel *already* does this by itself, and I'm attempting to explain
> why that is not sufficient.
>
> My point is precisely that the endianness information must be propagated
> to the user, otherwise the user may not have all the information it
> needs to emulate it.
>
> Here is the concrete example:
>       * guest writes to MMIO
>       * KVM passes MMIO information (physical address, number of bytes,
>         value) to qemu
>       * Qemu knows from the address that this access is for a passthough
>         device, a special case the administrator has pre-configured
>       * Qemu does mmap(/dev/mem), and writes "length" bytes of "value"
>         at offset "address".
>
> Now here's the catch: what endianness does qemu use when doing the
> write? If qemu only does BE, then a LE access from the guest will be
> byte-reversed when presented to the real hardware.
>   

Right, I forgot that bit when replying.

So, the data is always in natural endianness?  If so, we can add an 
endianness indicator to the mmio callbacks, which qemu will mostly 
ignore, and only examine it on passthrough.

btw, isn't passthrough better handled through the tlb?  i.e. actually 
let the guest access the specially-configured memory?  You can have qemu 
mmap /dev/mem and install it as a memslot, and things should work, no?  
(well, you might need to set some cachablility flag or other).

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to