Re: qemu-system-sh4eb build has something hinky in the ethernet
- To: Rob Landley <rob@landley.net>
- Cc: Philippe Mathieu-Daudé <philmd@linaro.org>, Geert Uytterhoeven <geert@linux-m68k.org>, QEMU Developers <qemu-devel@nongnu.org>, Thorsten Glaser <tg@debian.org>, Michael Tokarev <mjt@tls.msk.ru>, security@debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>, debian-superh@lists.debian.org
- Subject: Re: qemu-system-sh4eb build has something hinky in the ethernet
- From: Aurelien Jarno <aurelien@aurel32.net>
- Date: Wed, 31 Dec 2025 13:15:00 +0100
- Message-id: <[🔎] aVUTxBo4kXakotuC@aurel32.net>
- Mail-followup-to: Rob Landley <rob@landley.net>, Philippe Mathieu-Daudé <philmd@linaro.org>, Geert Uytterhoeven <geert@linux-m68k.org>, QEMU Developers <qemu-devel@nongnu.org>, Thorsten Glaser <tg@debian.org>, Michael Tokarev <mjt@tls.msk.ru>, security@debian.org, Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>, debian-superh@lists.debian.org
- In-reply-to: <[🔎] 6b3fdecb-739b-4149-8736-2fb6bd209d10@landley.net>
- References: <aKi6IWVX2uIlGKnw@seger.debian.org> <Pine.BSM.4.64L.2508230023030.21591@herc.mirbsd.org> <6abe2750-5e2c-43a1-be57-1dc2ccabdd91@tls.msk.ru> <119d5858-52f4-ce1b-9ee7-9615ce2054b9@debian.org> <79f14fef-123f-4938-b069-10f07e7d0405@landley.net> <CAMuHMdXZNroJF=s8gXj_vguGPGjUvgLu7w2PZxQg9tcHtSkNyg@mail.gmail.com> <351ebd4d-8ec6-43fe-b308-a0e54801a33b@linaro.org> <[🔎] 6b3fdecb-739b-4149-8736-2fb6bd209d10@landley.net>
Hi,
This discussion is specific to the SuperH port, therefore please avoid
mailing debian-ports@lists.debian.org, which targets all ports. I have
already adjusted the address in Cc: to debian-superh@lists.debian.org.
Thanks
Aurelien
On 2025-12-31 02:04, Rob Landley wrote:
> On 11/24/25 01:18, Philippe Mathieu-Daudé wrote:
> > On 1/9/25 09:47, Geert Uytterhoeven wrote:
> >
> > > On Sun, 24 Aug 2025 at 20:40, Rob Landley <rob@landley.net> wrote:
> > > > Anyway, this works fine on little endian, but the qemu-system-sh4eb
> > > > build has something hinky in the ethernet, I haven't tackled it myself
> > > > because I don't know whether the device emulation or the driver is
> > > > what's missing an endian swap. (I don't want to fix it the "wrong way",
> > >
> > > That is using sh_eth, right?
> > >
> > > Last time I tried booting a big-endian ARM kernel on R-Car M2-W,
> > > the Linux kernel booted fine, except for Ethernet. So sh_eth is
> > > definitely
> > > not big-endian clean.
> >
> > qemu-system-sh4{eb} only emulates the R2D+ board, which AFAIK
> > provides ethernet via a RTL8139 over PCI. While old, RTL8139
> > is very tested and expected to have endianness well handled.
>
> Expected, sure. In reality? Compare the sh4 vs sh4eb tarballs in
> https://landley.net/bin/mkroot/0.8.13/ (in each case extract and
> ./run-qemu.sh should get you a shell prompt).
>
> The sh4 one has working ethernet, the sh4eb one always reports link down and
> it doesn't seem to probe the mac address right. Built from almost the same
> configs, the only difference is:
>
> https://github.com/landley/toybox/blob/0.8.13/mkroot/mkroot.sh#L297
>
> Line 305 adds:
> [ "$CROSS" == sh4eb ] && KCONF+=,CPU_BIG_ENDIAN
>
> When I tried to track it down, I didn't know if the kernel or qemu was what
> had it backwards, so it went back on the todo heap and composted...
>
> > > [*] I didn't have a big-endian userspace.
>
> That script builds one, the resulting binary tarball is at
> https://landley.net/bin/mkroot/0.8.13/sh2eb.tgz and the toolchain I used is
> at
> https://landley.net/bin/toolchains/25-03-2024/sh4eb-linux-musl-cross.tar.xz
> which was built with https://landley.net/toybox/faq.html#cross2
>
> There might also be something wrong with -hda block device support, I'd have
> to check my notes. But I can work around lack of -hda with nbd-server, kinda
> hard to do it the other way...
>
> Rob
>
>
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
Reply to: