* [Buildroot] Xtensa qemu nommu defconfig not working
@ 2022-11-25 18:11 Thomas Petazzoni via buildroot
2022-11-28 11:54 ` Max Filippov
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-11-25 18:11 UTC (permalink / raw)
To: Max Filippov, Romain Naour, Niklas Cassel; +Cc: buildroot@buildroot.org
Hello,
The configs/qemu_xtensa_lx60_nommu_defconfig builds correctly, but
fails to boot under Qemu:
[ 1.158675] Freeing unused kernel image (initmem) memory: 460K
[ 1.159475] This architecture does not have kernel memory protection.
[ 1.160806] Run /init as init process
[ 1.186746] binfmt_flat: reloc outside program 0x24c80100 (0 - 0x6e430/0x56a20), killing init!
[ 1.190881] Failed to execute /init (error -8)
[ 1.191529] Run /sbin/init as init process
[ 1.204778] binfmt_flat: reloc outside program 0x24c80100 (0 - 0x6e430/0x56a20), killing init!
[ 1.206216] Starting init: /sbin/init exists but couldn't execute it (error -8)
[ 1.207229] Run /etc/init as init process
[ 1.209332] Run /bin/init as init process
[ 1.210517] Run /bin/sh as init process
[ 1.220290] binfmt_flat: reloc outside program 0x24c80100 (0 - 0x6e430/0x56a20), killing sh!
[ 1.221658] Starting init: /bin/sh exists but couldn't execute it (error -8)
[ 1.223403] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
[ 1.226218] ---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. ]---
There were some changes in elf2flt:
9dd179d43ffe9be98035f921a0db2bf051b632fb package/elf2flt: fix fatal error regression on m68k, xtensa, riscv64
95402089c314fbc03b934f5fcf9c29db043d758c package/elf2flt: remove broken patch
b07210b272c6e8810b038190cf5c1fd1f7b48397 package/gcc: remove BR2_GCC_ENABLE_LTO
9db5eb258cf492567bac33a33cb606f14045639d package/elf2flt: Remove Config.in.host
3e50b5fe2632a3081fd3f6574a5e9525fa897fdb package/elf2flt: update AUTORECONF comment
32f93b0ef2c602dfa1f5b243ba865d5b16e2fa33 package/elf2flt: update RISC-V 64-bits support
65d78dcfeb8b2eafaebe2d0c3c8c42e7e85f46ac package/elf2flt: update to version 2021.08
6d49446ebdbd32c1b4591c0aa8cacb189a69e318 package/elf2flt: add RISC-V 64-bits support
However, in commit 9dd179d43ffe9be98035f921a0db2bf051b632fb, Niklas
said about the qemu_xtensa_lx60_nommu_defconfig configuration: "xtensa
crashes when loading init, the same behavior as when reverting the bad
upstream elf2flt commit completely."
Max, do you think you could have a look at what is happening?
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] Xtensa qemu nommu defconfig not working
2022-11-25 18:11 [Buildroot] Xtensa qemu nommu defconfig not working Thomas Petazzoni via buildroot
@ 2022-11-28 11:54 ` Max Filippov
2022-11-28 13:12 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 5+ messages in thread
From: Max Filippov @ 2022-11-28 11:54 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Niklas Cassel, Romain Naour, buildroot@buildroot.org
Hi Thomas,
On Fri, Nov 25, 2022 at 10:11 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> The configs/qemu_xtensa_lx60_nommu_defconfig builds correctly, but
> fails to boot under Qemu:
>
> [ 1.158675] Freeing unused kernel image (initmem) memory: 460K
> [ 1.159475] This architecture does not have kernel memory protection.
> [ 1.160806] Run /init as init process
> [ 1.186746] binfmt_flat: reloc outside program 0x24c80100 (0 - 0x6e430/0x56a20), killing init!
> Max, do you think you could have a look at what is happening?
AFAICS the following commit in the elf2flt
https://github.com/uclinux-dev/elf2flt/commit/5e08f19683163584f23b953e570749964758c439
disabled address endianness fixup for addresses in the text segment for
xtensa which results in the observed failure. I haven't checked, but from
the code it looks like not only the xtensa may be affected.
I can confirm that reverting that change fixes xtensa nommu boot.
--
Thanks.
-- Max
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] Xtensa qemu nommu defconfig not working
2022-11-28 11:54 ` Max Filippov
@ 2022-11-28 13:12 ` Thomas Petazzoni via buildroot
2022-11-28 13:37 ` Max Filippov
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-11-28 13:12 UTC (permalink / raw)
To: Max Filippov; +Cc: Niklas Cassel, Romain Naour, buildroot@buildroot.org
On Mon, 28 Nov 2022 03:54:19 -0800
Max Filippov <jcmvbkbc@gmail.com> wrote:
> > Max, do you think you could have a look at what is happening?
>
> AFAICS the following commit in the elf2flt
> https://github.com/uclinux-dev/elf2flt/commit/5e08f19683163584f23b953e570749964758c439
>
> disabled address endianness fixup for addresses in the text segment for
> xtensa which results in the observed failure. I haven't checked, but from
> the code it looks like not only the xtensa may be affected.
> I can confirm that reverting that change fixes xtensa nommu boot.
Thanks for the investigation. How do we move forward from this? I must
say I never went into the details of elf2flt, so I'm not sure how to
fix this myself.
Should we report a bug to upstream elf2flt (which are generally never
looked at), or is someone volunteering to provide a fix for this?
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] Xtensa qemu nommu defconfig not working
2022-11-28 13:12 ` Thomas Petazzoni via buildroot
@ 2022-11-28 13:37 ` Max Filippov
2022-12-27 13:53 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 5+ messages in thread
From: Max Filippov @ 2022-11-28 13:37 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Niklas Cassel, Romain Naour, buildroot@buildroot.org
On Mon, Nov 28, 2022 at 5:12 AM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Should we report a bug to upstream elf2flt (which are generally never
> looked at), or is someone volunteering to provide a fix for this?
I'll check what other architectures are affected and will make a fix.
Also starting with linux-6.1 nommu xtensa will support static PIE ELF,
which is in every way better than bFLT. Will it be acceptable to add
static PIE ELF as an executable file format for nommu configurations
in the buildroot?
--
Thanks.
-- Max
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Buildroot] Xtensa qemu nommu defconfig not working
2022-11-28 13:37 ` Max Filippov
@ 2022-12-27 13:53 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-12-27 13:53 UTC (permalink / raw)
To: Max Filippov; +Cc: Niklas Cassel, Romain Naour, buildroot@buildroot.org
Hello Max,
On Mon, 28 Nov 2022 05:37:25 -0800
Max Filippov <jcmvbkbc@gmail.com> wrote:
> Also starting with linux-6.1 nommu xtensa will support static PIE ELF,
> which is in every way better than bFLT. Will it be acceptable to add
> static PIE ELF as an executable file format for nommu configurations
> in the buildroot?
Yes, that would definitely be acceptable and even useful.
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-12-27 13:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-25 18:11 [Buildroot] Xtensa qemu nommu defconfig not working Thomas Petazzoni via buildroot
2022-11-28 11:54 ` Max Filippov
2022-11-28 13:12 ` Thomas Petazzoni via buildroot
2022-11-28 13:37 ` Max Filippov
2022-12-27 13:53 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox