From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: bochs-developers@lists.sourceforge.net,
Paul Mackerras <paulus@samba.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] Endian control register
Date: Mon, 16 Jun 2014 21:07:41 +1000 [thread overview]
Message-ID: <1402916861.7661.55.camel@pasglop> (raw)
In-Reply-To: <CAFEAcA-XHt7CtNeAb4DcnuvbSKyMDnDSKuTLay7Tx0UVO5evPw@mail.gmail.com>
On Mon, 2014-06-16 at 11:45 +0100, Peter Maydell wrote:
> On 16 June 2014 11:30, Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> > So while trying to solve an issue we have with qemu/kvm and powerpc who
> > can be both LE and BE nowadays, we thought the ideal solution would be
> > to have a register in the emulated VGA to control the endian.
>
> > Any suggestion ? Comment ? Flame ? :-)
>
> My instinctive reaction is to ask if this exists in actual
> VGA hardware. If not, then it doesn't really seem like it
> belongs in our VGA device model...
Actual VGA HW try to handle endianness using a range of more or less
broken solutions, so it's hard to compare :-)
A whole range of them historically such as older radeons had "apertures"
with a HW swap on the PCI to VRAM path allowing them internally to
continue using the same pixel format in VRAM. But that has issue, the
swappers must be adjusted for the actual bpp and things get tricky if
several objects in VRAM have different bpp which becomes common with
textures, or even render masks.
nVidia is a bit smarter and I think have the swapper on the units
consuming the pixels, I think they have per "object" endian settings but
I'm not 100% certain.
Recent radeons also have swappers per units which is a lot saner.
What I propose is somewhat equivalent to the two latter, but with only a
single object/unit, which is the framebuffer (since we don't do other
accelerations or drawing).
So yes, it somewhat relates to what is done elsewhere :-)
It is also the best solution we could find to the problem after some
discussion on IRC. The other solution is to try to hook when the guest
does the hypercall (yay paravirtualization !) to switch the endian mode
of interrupts and use it to "adjust" qemu internal vga byteswap but
that's frankly a lot more gross than having the VGA provide a
self-contained endian setting.
Cheers,
Ben.
next prev parent reply other threads:[~2014-06-16 11:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-16 10:30 [Qemu-devel] Endian control register Benjamin Herrenschmidt
2014-06-16 10:45 ` Peter Maydell
2014-06-16 11:07 ` Benjamin Herrenschmidt [this message]
2014-06-23 0:43 ` Benjamin Herrenschmidt
2014-06-23 0:45 ` Benjamin Herrenschmidt
2014-06-23 3:32 ` Benjamin Herrenschmidt
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=1402916861.7661.55.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=agraf@suse.de \
--cc=bochs-developers@lists.sourceforge.net \
--cc=paulus@samba.org \
--cc=peter.maydell@linaro.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).