qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alexander Graf <agraf@suse.de>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"David Gibson" <dwg@au1.ibm.com>,
	"Andreas Färber" <afaerber@suse.de>,
	kvm-ppc@vger.kernel.org,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] virtio-pci: Fix endianness of virtio config
Date: Wed, 11 Jan 2012 08:04:28 +1100	[thread overview]
Message-ID: <1326229468.23910.69.camel@pasglop> (raw)
In-Reply-To: <77DAA08C-9D39-491A-B8AC-A23915FE2A3D@suse.de>

On Tue, 2012-01-10 at 21:46 +0100, Alexander Graf wrote:
> On 10.01.2012, at 21:35, Andreas Färber wrote:
> 
> > Am 10.01.2012 21:30, schrieb Alexander Graf:
> >> Maybe the RTAS callbacks really want you to return stuff in little
> endian?
> > 
> > IIRC all RTAS callbacks need to be in the same bitness and
> endianness
> > (MSR LE+SB) as when instantiating RTAS from OF.
> 
> Sure, the question is how the PCI controller is wired up usually. Just
> because RTAS works in native endianness doesn't mean that endianness
> of the actual device access isn't defined differently.

Eugh... you guys don't get it :-) This is -not- about the PCI
configuration space, but the virtio configuration space which is a
slightly different thing (PCI config space works with what's there at
the moment).

So this has nothing to do with e1000 or any other emulated device like
that, but it does have to do with virtio-blk for example.

The way virtio works is that the PIO BAR is split into two parts. The
first part (header) is a set of what's basically pseudo MMIO registers
that are little endian. The second part is device-specific an is ...
guest native endian. (Yeah it's horrible, I know).

This is how it's specified in the virtio spec and how Linux expects it,
with this patch, I can boot an existing fedora 16 with virtio-blk for
example.

Cheers,
Ben.

  reply	other threads:[~2012-01-10 21:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10 11:35 [Qemu-devel] [PATCH] virtio-pci: Fix endianness of virtio config Benjamin Herrenschmidt
2012-01-10 20:30 ` Alexander Graf
2012-01-10 20:35   ` Andreas Färber
2012-01-10 20:46     ` Alexander Graf
2012-01-10 21:04       ` Benjamin Herrenschmidt [this message]
2012-01-10 21:45         ` Alexander Graf
2012-01-10 22:04           ` Benjamin Herrenschmidt
2012-01-10 22:10             ` Benjamin Herrenschmidt
2012-01-10 22:02 ` Anthony Liguori
2012-01-10 22:41   ` Alexander Graf
2012-01-10 22:49     ` Benjamin Herrenschmidt
2012-01-10 22:52       ` Alexander Graf
2012-01-10 22:57         ` Alexander Graf

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=1326229468.23910.69.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=dwg@au1.ibm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@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).