From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQy7D-0006D3-2b for qemu-devel@nongnu.org; Mon, 08 Sep 2014 08:32:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQy72-0006kD-SM for qemu-devel@nongnu.org; Mon, 08 Sep 2014 08:32:15 -0400 Message-ID: <540DA1C4.4020405@suse.de> Date: Mon, 08 Sep 2014 14:32:04 +0200 From: Alexander Graf MIME-Version: 1.0 References: <20140630172611.24172.93339.stgit@bling.home> <20140630172803.24172.50309.stgit@bling.home> In-Reply-To: <20140630172803.24172.50309.stgit@bling.home> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 3/4] vfio: Make BARs native endian List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson , qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , qemu-ppc On 30.06.14 19:28, Alex Williamson wrote: > From: Alexey Kardashevskiy > > 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 > Signed-off-by: Alex Williamson 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