]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/loongarch/boot: Adjust the loading position of the initrd
authorXianglai Li <lixianglai@loongson.cn>
Tue, 6 May 2025 08:09:46 +0000 (16:09 +0800)
committerSong Gao <gaosong@loongson.cn>
Wed, 14 May 2025 07:57:23 +0000 (15:57 +0800)
commita3d5f62254a48b7c260d5aa7bd8e8467a0bb8ea3
treedcc7599a5f0de8b29066f3438cbc728196c62361
parentf4881c67ba8a852687566610949d8e9ab0542a31
hw/loongarch/boot: Adjust the loading position of the initrd

When only the -kernel parameter is used to load the elf kernel, the initrd
is loaded in the ram. If the initrd size is too large, the loading fails,
resulting in a VM startup failure. This patch first loads initrd near
the kernel.

When the nearby memory space of the kernel is insufficient, it tries to
load it to the starting position of high memory. If there is still not
enough, qemu will report an error and ask the user to increase the memory
space for the virtual machine to boot.

Signed-off-by: Xianglai Li <lixianglai@loongson.cn>
Message-Id: <20250506080946.817092-1-lixianglai@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
hw/loongarch/boot.c