diff mbox series

[2/5] selftests/nolibc: use EFI -bios for LoongArch qemu

Message ID 20231010-nolibc-out-of-tree-v1-2-b6a263859596@weissschuh.net (mailing list archive)
State New
Headers show
Series selftests/nolibc: various build improvements | expand

Commit Message

Thomas Weißschuh Oct. 10, 2023, 12:33 p.m. UTC
qemu for LoongArch does not work properly with direct kernel boot.
The kernel will panic during initialization and hang without any output.

When booting in EFI mode everything work correctly.

While users most likely don't have the LoongArch EFI binary installed at
least an explicit error about 'file not found' is better than a hanging
test without output that can never succeed.

Link: https://lore.kernel.org/loongarch/1738d60a-df3a-4102-b1da-d16a29b6e06a@t-8ch.de/
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

---
Note: I'm wondering how this worked for anybody else.
---
 tools/testing/selftests/nolibc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Willy Tarreau Oct. 22, 2023, 9:20 a.m. UTC | #1
Hi Thomas,

On Tue, Oct 10, 2023 at 02:33:57PM +0200, Thomas Weißschuh wrote:
> qemu for LoongArch does not work properly with direct kernel boot.
> The kernel will panic during initialization and hang without any output.
> 
> When booting in EFI mode everything work correctly.
> 
> While users most likely don't have the LoongArch EFI binary installed at
> least an explicit error about 'file not found' is better than a hanging
> test without output that can never succeed.

Agreed. Let's hope at least users will be able to figure what's
missing depending on the message. There's one thing, though, you
hard-coded the path to the file system, and it's unlikely to be
located at the same place for everyone:

   -bios /usr/share/edk2/loongarch64/OVMF_CODE.fd

Sure, it's also possible to force QEMU_ARGS but it's becoming complicated
due to the numerous arguments. Maybe use a QEMU_BIOS_loongarch variable
for this ? This way if this starts to generalize to other archs, we can
later simplify it and automatically append -bios when needed.

> Link: https://lore.kernel.org/loongarch/1738d60a-df3a-4102-b1da-d16a29b6e06a@t-8ch.de/
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> 
> ---
> Note: I'm wondering how this worked for anybody else.

Not much surprised. As I mentioned, my qemu currently doesn't support
loongarch so I didn't boot that one. Maybe Zhangjin had this one as
part of his other patches.

Overall, on the principle, Acked-by: Willy Tarreau <w@1wt.eu>

Thanks!
Willy
Thomas Weißschuh Oct. 24, 2023, 4:06 p.m. UTC | #2
Oct 22, 2023 11:21:16 Willy Tarreau <w@1wt.eu>:

> On Tue, Oct 10, 2023 at 02:33:57PM +0200, Thomas Weißschuh wrote:
>> qemu for LoongArch does not work properly with direct kernel boot.
>> The kernel will panic during initialization and hang without any output.
>>
>> When booting in EFI mode everything work correctly.
>>
>> While users most likely don't have the LoongArch EFI binary installed at
>> least an explicit error about 'file not found' is better than a hanging
>> test without output that can never succeed.
>
> Agreed. Let's hope at least users will be able to figure what's
> missing depending on the message. There's one thing, though, you
> hard-coded the path to the file system, and it's unlikely to be
> located at the same place for everyone:
>
>    -bios /usr/share/edk2/loongarch64/OVMF_CODE.fd
>
> Sure, it's also possible to force QEMU_ARGS but it's becoming complicated
> due to the numerous arguments. Maybe use a QEMU_BIOS_loongarch variable
> for this ? This way if this starts to generalize to other archs, we can
> later simplify it and automatically append -bios when needed.

My hope was for it to be a purely temporary bandaid.
But you are right, let's do it properly from the beginning.

>> Link: https://lore.kernel.org/loongarch/1738d60a-df3a-4102-b1da-d16a29b6e06a@t-8ch.de/
>> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
>>
>> ---
>> Note: I'm wondering how this worked for anybody else.
>
> Not much surprised. As I mentioned, my qemu currently doesn't support
> loongarch so I didn't boot that one. Maybe Zhangjin had this one as
> part of his other patches.
>
> Overall, on the principle, Acked-by: Willy Tarreau <w@1wt.eu>

Thanks!
Willy Tarreau Oct. 24, 2023, 4:13 p.m. UTC | #3
On Tue, Oct 24, 2023 at 06:06:11PM +0200, Thomas Weißschuh  wrote:
> Oct 22, 2023 11:21:16 Willy Tarreau <w@1wt.eu>:
> 
> > On Tue, Oct 10, 2023 at 02:33:57PM +0200, Thomas Weißschuh wrote:
> >> qemu for LoongArch does not work properly with direct kernel boot.
> >> The kernel will panic during initialization and hang without any output.
> >>
> >> When booting in EFI mode everything work correctly.
> >>
> >> While users most likely don't have the LoongArch EFI binary installed at
> >> least an explicit error about 'file not found' is better than a hanging
> >> test without output that can never succeed.
> >
> > Agreed. Let's hope at least users will be able to figure what's
> > missing depending on the message. There's one thing, though, you
> > hard-coded the path to the file system, and it's unlikely to be
> > located at the same place for everyone:
> >
> >    -bios /usr/share/edk2/loongarch64/OVMF_CODE.fd
> >
> > Sure, it's also possible to force QEMU_ARGS but it's becoming complicated
> > due to the numerous arguments. Maybe use a QEMU_BIOS_loongarch variable
> > for this ? This way if this starts to generalize to other archs, we can
> > later simplify it and automatically append -bios when needed.
> 
> My hope was for it to be a purely temporary bandaid.
> But you are right, let's do it properly from the beginning.

The right way to think about temporary code is that if it's supposed to
be quick to address, you don't want to introduce a temporary way of
proceeding that will change later as the change will annoy some users.
And if the reason for the temporary step is a temporary difficulty, you
can be certain nobody will ever try to address it and that temporary
will be definitive. So thinking "temporary" should generally ring a
bell "am I going to annoy users for no reason or am I putting myself in
a wrong corner". That's why I really try to avoid anything "temporary".
(But there's no problem with making the wrong choice and regretting
later, of course ;-)).

Cheers,
Willy
diff mbox series

Patch

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index af60e07d3c12..258293639572 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -100,7 +100,7 @@  QEMU_ARGS_ppc64      = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC
 QEMU_ARGS_ppc64le    = -M powernv -append "console=hvc0 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_riscv      = -M virt -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
 QEMU_ARGS_s390       = -M s390-ccw-virtio -m 1G -append "console=ttyS0 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
-QEMU_ARGS_loongarch  = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)"
+QEMU_ARGS_loongarch  = -M virt -append "console=ttyS0,115200 panic=-1 $(TEST:%=NOLIBC_TEST=%)" -bios /usr/share/edk2/loongarch64/OVMF_CODE.fd
 QEMU_ARGS            = $(QEMU_ARGS_$(XARCH)) $(QEMU_ARGS_EXTRA)
 
 # OUTPUT is only set when run from the main makefile, otherwise