Re: [PATCH 0/2] kunit: tool: Add support for SH under QEMU

David Gow <[email protected]>
Newsgroups gmane.linux.ports.sh.devel
Message-ID <CABVgOSmgpkktiLkU-ic0xGitDOhep+3sb5X91hb8RNEzFauhAA@mail.gmail.com>
On Sat, 4 Mar 2023 at 13:33, David Gow <[email protected]> wrote:
>
> On Fri, 3 Mar 2023 at 15:42, Geert Uytterhoeven <[email protected]> wrote:
> >
> > Hi David,
> >
> > On Fri, Mar 3, 2023 at 8:26 AM David Gow <[email protected]> wrote:
> > > On Tue, 28 Feb 2023 at 18:31, Geert Uytterhoeven
> > > <[email protected]> wrote:
> > > > This patch series adds support to run tests via kunit_tool on the
> > > > SuperH-based virtualized r2d platform.  As r2d uses the second serial
> > > > port as the console, this needs a small modification of the core
> > > > infrastructure.
> > > >
> > > > Thanks for your comments!
> > >
> > > This series looks good to me, but I've not been able to successfully
> > > get qemu to boot anything on SuperH (it just seems to hang with no
> > > output).
> > >
> > > Is there anything like magic config or firmware images (I didn't think
> > > so for r2d: shix prints out an error, though) required to get this
> > > going?
> >
> > No idea. I thought it just works.
> >
>
> Strange: I'm not able to get anything to boot here, regardless of the
> versions I use.
>
> I'm definitely not convinced that it's a qemu issue, as opposed to a
> kernel issue, but either way I can't get anything to boot.
>
> > > The qemu command KUnit is using seems correct (and none of the obvious
> > > permutations, particularly around the serial ports seem to help):
> > > qemu-system-sh4 -nodefaults -m 1024 -kernel .kunit/arch/sh/boot/zImage
> > > -append 'kunit.enable=1 console=ttySC1 kunit_shutdown=reboot'
> > > -no-reboot -nographic -serial null -machine r2d -serial mon:stdio
> >
> > That works just fine for me.
> >
> > On plain v6.2 with this series applied:
> > $ ./tools/testing/kunit/kunit.py run --arch=sh
> > --cross_compile=sh4-linux-gnu- --raw_output=all --kunitconfig
> > fs/ext4/.kunitconfig
> > [08:38:59] Configuring KUnit Kernel ...
> > Regenerating .config ...
> > Populating config with:
> > $ make ARCH=sh O=.kunit olddefconfig CROSS_COMPILE=sh4-linux-gnu-
> > [08:39:01] Building KUnit Kernel ...
> > Populating config with:
> > $ make ARCH=sh O=.kunit olddefconfig CROSS_COMPILE=sh4-linux-gnu-
> > Building with:
> > $ make ARCH=sh O=.kunit --jobs=12 CROSS_COMPILE=sh4-linux-gnu-
> > <stdin>:1517:2: warning: #warning syscall clone3 not implemented [-Wcpp]
> > [... more warnings ...]
> > [08:39:51] Starting KUnit Kernel (1/1)...
> > Running tests with:
> > $ qemu-system-sh4 -nodefaults -m 1024 -kernel
> > .kunit/arch/sh/boot/zImage -append 'kunit.enable=1 console=ttySC1
> > kunit_shutdown=reboot' -no-reboot -nographic -serial null -machine r2d
> > -serial mon:stdio
> > Linux version 6.2.0-00002-g5b394444bb0d (geert@rox) (sh4-linux-gnu-gcc
> > (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for
> > Ubuntu) 2.38) #3 Fri Mar  3 08:39:50 CET 2023
> > ...
> >
>
> I see the same issue with a clean 6.2 and these patches, with both
> "sh4-linux-gnu-gcc (Debian 12.2.0-10) 12.2.0" and
> "sh4-linux-gnu-gcc-11 (Debian 11.3.0-8) 11.3.0".
>

Looks like this is an issue with the compiler in Debian testing.

Broken (Debian Testing):
sh4-linux-gnu-gcc (Debian 12.2.0-10) 12.2.0
Works (From https://mirrors.edge.kernel.org/pub/tools/crosstool/ ):
sh4-linux-gcc (GCC) 12.2.0
Works (Debian Stable):
sh4-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110

I'll leave debugging it here, as my SuperH knowledge is nonexistant,
but there's definitely something going wrong.

Cheers,
-- David
smime.p7s (application/pkcs7-signature, 3.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.