On 17/04/2023 19.21, Mikhail R. Gadelha wrote:
Hi qemu folks,

I'm using yocto to generate a riscv32 image but qemu seems to be ignoring the -m argument from the command line and forcing the image to run with 988MB of RAM.

Is there any way I can increase it to 4G?

I'm using the following cmdline to start qemu:

qemu-system-riscv32 -nographic -machine virt -m 4G -smp 8 -bios /home/mgadelha/tools/poky/build/tmp/deploy/images/qemuriscv32/fw_jump.elf -kernel /home/mgadelha/tools/poky/build/tmp/deploy/images/qemuriscv32/Image -append "root=/dev/vda rw mem=4G" -drive

That "mem=4G" part of the -append option looks suspicious ... have you already tried to boot without that, or to decrease it to a number that fits into 32-bit, e.g. "mem=3G" ?

 HTH,
  Thomas

id=disk0,file=/home/mgadelha/tools/poky/build/tmp/deploy/images/qemuriscv32/core-image-full-cmdline-qemuriscv32-20230415202008.rootfs.ext4,if=none,format=raw
 -device virtio-net-device,netdev=usernet -netdev 
user,id=usernet,hostfwd=tcp::22222-:22 -device virtio-blk-device,drive=disk0 
-object rng-random,filename=/dev/urandom,id=rng0 -device 
virtio-rng-pci,rng=rng0 -device virtio-tablet-pci -device virtio-keyboard-pci

Well, it actually doesn't start if I use -m 4G, but any value lower than that is fine.

Here's also the boot log: https://pastebin.com/b7ZEP659 <https://pastebin.com/b7ZEP659>

I see that the kernel prints:

[    0.000000] Memory limited to 1024MB

so maybe it's a kernel limitation rather than qemu?

--

Mikhail Ramalho.


Reply via email to