hw: riscv: Allow large kernels to boot by moving the initrd further away in RAM
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Tue, 6 Feb 2024 15:40:42 +0000 (16:40 +0100)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 8 Mar 2024 05:41:31 +0000 (15:41 +1000)
commit119ea3576b5b62c35a186e0aa8b5eef9d0d21b35
tree60fb76122d232606cb082517caab4da8833371ef
parent3e6f1e61b4bc0facd13967580feed47d96a2c28c
hw: riscv: Allow large kernels to boot by moving the initrd further away in RAM

Currently, the initrd is placed at 128MB, which overlaps with the kernel
when it is large (for example syzbot kernels are). From the kernel side,
there is no reason we could not push the initrd further away in memory
to accommodate large kernels, so move the initrd at 512MB when possible.

The ideal solution would have been to place the initrd based on the
kernel size but we actually can't since the bss size is not known when
the image is loaded by load_image_targphys_as() and the initrd would
then overlap with this section.

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20240206154042.514698-1-alexghiti@rivosinc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/riscv/boot.c