qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL 3/4] vfio: Make BARs native endian


From: Alexander Graf
Subject: Re: [Qemu-devel] [PULL 3/4] vfio: Make BARs native endian
Date: Mon, 08 Sep 2014 14:32:04 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.1.0


On 30.06.14 19:28, Alex Williamson wrote:
> From: Alexey Kardashevskiy <address@hidden>
> 
> Slow BAR access path is used when VFIO fails to mmap() BAR.
> Since this is just a transport between the guest and a device, there is
> no need to do endianness swapping.
> 
> This changes BARs to use native endianness. Since non-ROM BARs were
> doing byte swapping, we need to remove it so does the patch.
> As the result, this eliminates cancelling byte swaps and there is
> no change in behavior for non-ROM BARs.
> 
> ROM BARs were declared little endian too but byte swapping was not
> implemented for them so they never actually worked on big endian systems
> as there was no cancelling byte swap. This fixes endiannes for ROM BARs
> by declaring them native endian and only fixing access sizes as it is
> done for non-ROM BARs.
> 
> Signed-off-by: Alexey Kardashevskiy <address@hidden>
> Signed-off-by: Alex Williamson <address@hidden>

This patch is semantically wrong. We now assume that target endian ==
host endian.

Instead, the correct fix would have been to introduce the le read/write
accessors to ROM regions as well.


Alex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]