mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] arch: make RELR depend on EXPERIMENTAL
@ 2026-04-16  5:56 Ahmad Fatoum
  2026-04-17  8:03 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2026-04-16  5:56 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The rock3a crashes inside mem_malloc_init with RELR enabled

>rockchip-dmc: rockchip_sdram_size(reg2=100002c1, reg3=30001001)
rockchip-dmc: rank 1 cs0_col 10 bk 3 cs0_row 16 bw 2 row_3_4 0
rockchip-dmc: rk3568_ram0_size() = 2147483648
uncompress.c: memory at 0x00a00000, size 0x7f600000
endmem                = 0x80000000
arm_mem_scratch       = 0x7fff8000+0x00008000
arm_mem_stack         = 0x7fff0000+0x00008000
arm_mem_guard_page    = 0x7ffef000+0x00001000
arm_mem_ttb           = 0x7ff80000+0x00040000
arm_mem_barebox_image = 0x7fc00000+0x00400000
arm_mem_early_malloc  = 0x7fbe0000+0x00020000
membase               = 0x00a00000+0x7f600000
mmu: enabling MMU, ttb @ 0x7ff80000
mmu: __arch_remap_range: 0x00000000+0x8000000000 type UNCACHED
mmu: __arch_remap_range: 0x8000000000+0x8000000000 type UNCACHED
mmu: __arch_remap_range: 0x00a00000+0x7f600000 type RWX
mmu: __arch_remap_range: 0x80000000+0x0 type FAULT
mmu: __arch_remap_range: 0x00b00000+0x58000 type RWX
uncompress.c: uncompressing barebox ELF at 0x0000000000b580e0 (size 0x000a6d0a) to 0x7fc00000 (uncompressed size: 0x001724a8)
uncompress.c: relocating ELF in place
In-place ELF relocation: text_vaddr=0x0, text_offset=0x10000, load_addr=000000007fc00000, offset=0x7fc10000
No RELA relocations or invalid relocation info
In-place ELF relocation completed successfully
pbl-mmu: Setting up MMU from ELF segments
pbl-mmu: Segment 0 not page-aligned, rounding
pbl-mmu: Segment 0: addr=0x7fc10000 size=0x000ae000 flags=0x5 [R-X] -> mmu_flags=0x3
mmu: __arch_remap_range: 0x7fc10000+0xae000 type CODE
pbl-mmu: Segment 1 not page-aligned, rounding
pbl-mmu: Segment 1: addr=0x7fcbe000 size=0x0005c000 flags=0x4 [R--] -> mmu_flags=0x4
mmu: __arch_remap_range: 0x7fcbe000+0x5c000 type RO
pbl-mmu: Segment 3 not page-aligned, rounding
pbl-mmu: Segment 3: addr=0x7fd1a000 size=0x00061000 flags=0x6 [RW-] -> mmu_flags=0x1
mmu: __arch_remap_range: 0x7fd1a000+0x61000 type CACHED
pbl-mmu: MMU setup from ELF complete
uncompress.c: jumping to ELF entry point at 0x000000007fcbb4bc
start.c: memory at 0x00a00000, size 0x7f600000
start.c: initializing malloc pool at 0x40380000 (size 0x3f980000)
PANIC: unable to handle paging request at address 0x000000007fcffff0
DABT (current EL) (ESR 0x9600004f)
elr: 000000007fc1c064 lr : 000000007fc1c064
x0 : 000000007fcffff0 x1 : 000000003f97e869
x2 : 000000003f97e868 x3 : fffffffffffffff8
x4 : 000000007fff7e9c x5 : 000000007fff7e98
x6 : 0000000000000020 x7 : 000000007fff7988
x8 : 0000000000000010 x9 : 000000007fcef52a
x10: 0000000000000000 x11: 0000000000000002
x12: 0000000000000002 x13: 0000000000000000
x14: 000000007fc10000 x15: 0000000000b01a54
x16: 0000000000b01abc x17: 0000000000000000
x18: 0000000000000000 x19: 0000000040381780
x20: 0000000040381780 x21: 000000007fd72000
x22: 0000000080000000 x23: 000000007f600000
x24: 0000000080000000 x25: 000000007fe724a8
x26: 00000000000a6d0a x27: 00000000001724a8
x28: 0000000000000000 x29: 000000007fff7e80

Until understood and repaired, prevent RELR from being the default.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/Kconfig | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index e385b3bdb97c..858dd6b28383 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -54,13 +54,19 @@ config ARCH_HAS_RELR
 config RELR
 	bool "Use RELR relocation packing"
 	depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
-	default y
+	depends on EXPERIMENTAL
 	help
 	  Store the dynamic relocations in the RELR relocation packing
 	  format. Requires a compatible linker (LLD supports this feature), as
 	  well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
 	  are compatible).
 
+	  This can save ~10% of binary size, more if the final barebox image
+	  contains less external firmware blobs.
+
+	  This is marked experimental until the early hang for rock3a when
+	  this is enabled is understood and repaired.
+
 config ARCH_HAS_CTRLC
 	bool
 
-- 
2.47.3




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH master] arch: make RELR depend on EXPERIMENTAL
  2026-04-16  5:56 [PATCH master] arch: make RELR depend on EXPERIMENTAL Ahmad Fatoum
@ 2026-04-17  8:03 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2026-04-17  8:03 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Thu, 16 Apr 2026 07:56:07 +0200, Ahmad Fatoum wrote:
> The rock3a crashes inside mem_malloc_init with RELR enabled
> 
> >rockchip-dmc: rockchip_sdram_size(reg2=100002c1, reg3=30001001)
> rockchip-dmc: rank 1 cs0_col 10 bk 3 cs0_row 16 bw 2 row_3_4 0
> rockchip-dmc: rk3568_ram0_size() = 2147483648
> uncompress.c: memory at 0x00a00000, size 0x7f600000
> endmem                = 0x80000000
> arm_mem_scratch       = 0x7fff8000+0x00008000
> arm_mem_stack         = 0x7fff0000+0x00008000
> arm_mem_guard_page    = 0x7ffef000+0x00001000
> arm_mem_ttb           = 0x7ff80000+0x00040000
> arm_mem_barebox_image = 0x7fc00000+0x00400000
> arm_mem_early_malloc  = 0x7fbe0000+0x00020000
> membase               = 0x00a00000+0x7f600000
> mmu: enabling MMU, ttb @ 0x7ff80000
> mmu: __arch_remap_range: 0x00000000+0x8000000000 type UNCACHED
> mmu: __arch_remap_range: 0x8000000000+0x8000000000 type UNCACHED
> mmu: __arch_remap_range: 0x00a00000+0x7f600000 type RWX
> mmu: __arch_remap_range: 0x80000000+0x0 type FAULT
> mmu: __arch_remap_range: 0x00b00000+0x58000 type RWX
> uncompress.c: uncompressing barebox ELF at 0x0000000000b580e0 (size 0x000a6d0a) to 0x7fc00000 (uncompressed size: 0x001724a8)
> uncompress.c: relocating ELF in place
> In-place ELF relocation: text_vaddr=0x0, text_offset=0x10000, load_addr=000000007fc00000, offset=0x7fc10000
> No RELA relocations or invalid relocation info
> In-place ELF relocation completed successfully
> pbl-mmu: Setting up MMU from ELF segments
> pbl-mmu: Segment 0 not page-aligned, rounding
> pbl-mmu: Segment 0: addr=0x7fc10000 size=0x000ae000 flags=0x5 [R-X] -> mmu_flags=0x3
> mmu: __arch_remap_range: 0x7fc10000+0xae000 type CODE
> pbl-mmu: Segment 1 not page-aligned, rounding
> pbl-mmu: Segment 1: addr=0x7fcbe000 size=0x0005c000 flags=0x4 [R--] -> mmu_flags=0x4
> mmu: __arch_remap_range: 0x7fcbe000+0x5c000 type RO
> pbl-mmu: Segment 3 not page-aligned, rounding
> pbl-mmu: Segment 3: addr=0x7fd1a000 size=0x00061000 flags=0x6 [RW-] -> mmu_flags=0x1
> mmu: __arch_remap_range: 0x7fd1a000+0x61000 type CACHED
> pbl-mmu: MMU setup from ELF complete
> uncompress.c: jumping to ELF entry point at 0x000000007fcbb4bc
> start.c: memory at 0x00a00000, size 0x7f600000
> start.c: initializing malloc pool at 0x40380000 (size 0x3f980000)
> PANIC: unable to handle paging request at address 0x000000007fcffff0
> DABT (current EL) (ESR 0x9600004f)
> elr: 000000007fc1c064 lr : 000000007fc1c064
> x0 : 000000007fcffff0 x1 : 000000003f97e869
> x2 : 000000003f97e868 x3 : fffffffffffffff8
> x4 : 000000007fff7e9c x5 : 000000007fff7e98
> x6 : 0000000000000020 x7 : 000000007fff7988
> x8 : 0000000000000010 x9 : 000000007fcef52a
> x10: 0000000000000000 x11: 0000000000000002
> x12: 0000000000000002 x13: 0000000000000000
> x14: 000000007fc10000 x15: 0000000000b01a54
> x16: 0000000000b01abc x17: 0000000000000000
> x18: 0000000000000000 x19: 0000000040381780
> x20: 0000000040381780 x21: 000000007fd72000
> x22: 0000000080000000 x23: 000000007f600000
> x24: 0000000080000000 x25: 000000007fe724a8
> x26: 00000000000a6d0a x27: 00000000001724a8
> x28: 0000000000000000 x29: 000000007fff7e80
> 
> [...]

Applied, thanks!

[1/1] arch: make RELR depend on EXPERIMENTAL
      https://git.pengutronix.de/cgit/barebox/commit/?id=e2034126a4f8 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-17  8:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-16  5:56 [PATCH master] arch: make RELR depend on EXPERIMENTAL Ahmad Fatoum
2026-04-17  8:03 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox