All of lore.kernel.org
 help / color / mirror / Atom feed
* (overlapping) lmb allocations during boot
@ 2021-10-31 10:43 Michael Walle
  2021-10-31 11:44 ` Mark Kettenis
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Walle @ 2021-10-31 10:43 UTC (permalink / raw)
  To: u-boot

Hi,

I sometimes see a corrupted initrd during kernel boot on my board
(kontron_sl28). Debugging showed that in this case the spin table
for the secondary CPUs overlaps with the lmb initrd allocations
(initrd_high is set).

I had a look at how the fdt and initrd are relocated (if enabled). In
summary, they use lmb_alloc() which will first add all available memory
and then carve out reserved regions. There are calls for arch
(arch_lmb_reserve()) and board (board_lmb_reserve()) callbacks. The
interesting thing is that, there is also code to carve out any
reserved regions which were added to the fdt earlier
(boot_fdt_add_mem_rsv_regions()). The problem here is, that the DT 
fixups,
which might add the reserved regions are called just before jumping to
linux. Thus both the allocation for the fdt (if fdt_high is set) and
the ramdisk (if initrd_high is set) will ignore any reserved memory
regions.

Unfortunately, I don't see any good way to fix this. You'd need all the
DT fixups before we can initialize the lmb. Also, I don't know if this
will affect any other areas; probably I'm the only one, who reserves an
area which is outside of the u-boot code and data segment.

A hackish way would be to carve out the spin_table code in
board_lmb_reserve(). But meh..

-michael

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

end of thread, other threads:[~2021-10-31 22:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-31 10:43 (overlapping) lmb allocations during boot Michael Walle
2021-10-31 11:44 ` Mark Kettenis
2021-10-31 12:04   ` Michael Walle
2021-10-31 12:51     ` Mark Kettenis
2021-10-31 15:19       ` Michael Walle
2021-10-31 17:36         ` Mark Kettenis
2021-10-31 22:48           ` Michael Walle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.