qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-devel@nongnu.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH-for-9.2? v2 1/2] hw/display/vga: Do not reset 'big_endian_fb' in vga_common_reset()
Date: Mon, 09 Dec 2024 12:12:10 +1100	[thread overview]
Message-ID: <f88fb00840ff7a64a8edb620f55c41ac0af4a5cb.camel@kernel.crashing.org> (raw)
In-Reply-To: <46kzowk6brtwqrelpplth2l4axeyrqj3n3inzfnwavbtw7ls3c@vdssph2yubx2>

On Fri, 2024-12-06 at 10:28 +0100, Gerd Hoffmann wrote:
> > 
> > OPAL (well skiboot) doesn't display anything anyways (or at least
> > it
> > didn't when I wrote it :-). It just boots Linux as a bootloader. So
> > as
> > long as Linux itself sets the register it should be fine.
> 
> Oh, mixed up the firmware names, it's SLOF not OPAL.
> 
> sorry for the confusion,

Looking at SLOF source, it doesn't know about the endian register at
all indeed, it also doesn't put an endian propery in the device-node,
and probably expects the fb to be BE on reboot. Gosh I also wrote that
code... a looong time ago, I had forgotten all about it.

On SPAPR where endian *is* switched, qemu will also switch the endian
of the framebuffer on an explicit mode switch via the H_SET_MODE
hypercall. But afaik that does NOT include a reboot (at least from 10mn
browsing the code).

So I think the patch will have the effect of breaking the framebuffer
in SLOF on reboot when using SPAPR with an LE OS.

Something like this might work around it:

--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1737,6 +1737,9 @@ static void spapr_machine_reset(MachineState *machine, ResetType type)
 
     spapr_clear_pending_events(spapr);
 
+    /* Switch VGA to big endian */
+    spapr_pci_switch_vga(spapr, true);
+
     /*
      * We place the device tree just below either the top of the RMA,
      * or just below 2GB, whichever is lower, so that it can be

I can't test right now, I might later this week, ping me if you don't
hear from me.

Cheers,
Ben.



  reply	other threads:[~2024-12-09  1:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29 10:17 [PATCH v2 0/2] hw/display/vga: Do not reset 'big_endian_fb' in vga_common_reset() Philippe Mathieu-Daudé
2024-11-29 10:17 ` [PATCH-for-9.2? v2 1/2] " Philippe Mathieu-Daudé
2024-12-02 19:48   ` Philippe Mathieu-Daudé
2024-12-03  1:30     ` Benjamin Herrenschmidt
2024-12-03 10:51       ` Gerd Hoffmann
2024-12-03 12:21         ` BALATON Zoltan
2024-12-05 23:00         ` Benjamin Herrenschmidt
2024-12-06  9:28           ` Gerd Hoffmann
2024-12-09  1:12             ` Benjamin Herrenschmidt [this message]
2024-11-29 10:17 ` [PATCH v2 2/2] hw/display/vga: Remove pointless VGACommonState::default_endian_fb Philippe Mathieu-Daudé

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=f88fb00840ff7a64a8edb620f55c41ac0af4a5cb.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@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).