On Tue, Jun 7, 2022 at 10:11 AM Geert Uytterhoeven <ge...@linux-m68k.org> wrote: > On Sun, Jun 5, 2022 at 9:32 AM Stafford Horne <sho...@gmail.com> wrote: > > On Sun, Jun 05, 2022 at 10:58:14AM +0900, Stafford Horne wrote: > > It might be a good idea to revisit the qemu implementation and make > > sure that the extra byteswap is only inserted on m68k and not on > > other targets, but hopefully there are no new targets based on goldfish > > anymore and we don't need to care. > > > > So, it seems that in addition to my patch we would need something in m68k to > > switch it back to 'native' (big) endian? > > > > Looking at the m68k kernel/qemu interface I see: > > > > Pre 5.19: > > (data) <-- kernel(readl / little) <-- m68k qemu (native / big) - RTC/PIC > > (data) <-- kernel(__raw_readl / big) <-- m68k qemu (native / big) - TTY > > > > 5.19: > > (data) <-- kernel(gf_ioread32 / big) <-- m68k qemu (native / big) - all > > > > The new fixes to add gf_ioread32/gf_iowrite32 fix this for goldfish and > > m68k. > > This wouldn't have been an issue for little-endian platforms where > > readl/writel > > were originally used. > > > > Why can't m68k switch to little-endian in qemu and the kernel? The m68k > > virt > > platform is not that old, 1 year? Are there a lot of users that this would > > be a big > > problem? > > > > [1] > > https://lore.kernel.org/lkml/CAK8P3a1oN8NrUjkh2X8jHQbyz42Xo6GSa=5n0gd6vqcxrjm...@mail.gmail.com/
Goldfish is a very old platform, as far as I know only the kernel port is new. I don't know when qemu started shipping goldfish, but changing it now would surely break compatibility with whatever OS the port was originally made for. Arnd