[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-9.2? v2 1/2] hw/display/vga: Do not reset 'big_endian_fb'
From: |
Benjamin Herrenschmidt |
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 |
User-agent: |
Evolution 3.52.3-0ubuntu1 |
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.