[Skiboot] [PATCH] asm/head.S: fix hang in multi-threaded mambo
Stewart Smith
stewart at linux.vnet.ibm.com
Mon Mar 7 14:10:40 AEDT 2016
Oliver O'Halloran <oohall at gmail.com> writes:
> In very early boot, skiboot places secondary threads in holding loop
> until the primary thread has finished relocating skiboot. The secondary
> threads wait until a flag at INITAL_OFFSET + offsetof(boot_flag) is set
> to one before continuing. After relocating the skiboot image and
> applying ELF relocations the sets this flag and continues booting.
>
> To avoid having to copy skiboot at runtime within the simulation e605691e
> introduced a change to have the skiboot.tcl mambo script load skiboot at
> it's preferred location of 0x30000000 rather than 0x00000000.
> Unfortunately, the relocation code path is also responsible for saving the
> inital offset pointer (into r15). When not taken this results in the main
> thread writing to r15 + offsetof(boot_flag) instead, which leaves the
> secondary threads stuck waiting for boot_flag and the main thread stuck
> when trying to call-in the secondary threads during CPU initialisation.
>
> This patch fixes the bug by saving the inital offset before checking if
> relocation is necessary and adds a few comments to better document the
> relocation process.
>
> Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
Appears to make some sense, and verified by trying it with/without this
patch.
MErged to master as of 1141ca0f74d9cf8dc8456f5ea9248e82b468d36b
--
Stewart Smith
OPAL Architect, IBM.
More information about the Skiboot
mailing list