From: Alexander Graf <agraf@suse.de>
To: Alex Williamson <alex.williamson@redhat.com>, qemu-devel@nongnu.org
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>, qemu-ppc <qemu-ppc@nongnu.org>
Subject: Re: [Qemu-devel] [PULL 3/4] vfio: Make BARs native endian
Date: Mon, 08 Sep 2014 14:32:04 +0200 [thread overview]
Message-ID: <540DA1C4.4020405@suse.de> (raw)
In-Reply-To: <20140630172803.24172.50309.stgit@bling.home>
On 30.06.14 19:28, Alex Williamson wrote:
> From: Alexey Kardashevskiy <aik@ozlabs.ru>
>
> 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 <aik@ozlabs.ru>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
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
next prev parent reply other threads:[~2014-09-08 12:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-30 17:27 [Qemu-devel] [PULL 0/4] VFIO fixes for QEMU 2.1 Alex Williamson
2014-06-30 17:27 ` [Qemu-devel] [PULL 1/4] vfio-pci: Fix MSI/X debug code Alex Williamson
2014-06-30 17:27 ` [Qemu-devel] [PULL 2/4] vfio-pci: Fix MSI-X masking performance Alex Williamson
2014-06-30 17:28 ` [Qemu-devel] [PULL 3/4] vfio: Make BARs native endian Alex Williamson
2014-09-08 12:32 ` Alexander Graf [this message]
2014-06-30 17:28 ` [Qemu-devel] [PULL 4/4] vfio: use correct runstate Alex Williamson
2014-06-30 17:47 ` [Qemu-devel] [PULL 0/4] VFIO fixes for QEMU 2.1 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=540DA1C4.4020405@suse.de \
--to=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).