kvmtool / kvmtool

Stand-alone Native Linux KVM Tool repo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

linux image vs guest memory size

jiahzhang opened this issue · comments

kvmtool/riscv/kvm.c

Lines 101 to 105 in e17d182

/*
* Linux requires the initrd and dtb to be mapped inside lowmem,
* so we can't just place them at the top of memory.
*/
limit = kvm->ram_start + min(kvm->ram_size, (u64)SZ_256M) - 1;

Might be a noob question, but isn't this line counter-intuitive? If the linux image is large enough (> 256M), then we will fail on the later file read even if we keep increasing guest memory size with -m. At least for me, this was confusing because I kept hitting the same kernel image too big to fit in guest memory. message even when I knew I had allocated enough.