Prechádzať zdrojové kódy

board/qemu/riscv{32, 64}-virt: nommu: needs virtio-blk device

Commit [1] removed virtio-blk-device,drive=hd0 from the Qemu command
line since RISC-V virt target now define a default type for block
devices (virtio) [2].

While it's was working as expected using
qemu_riscv{32,64}_virt_defconfig, it doesn't work for nommu variant.

Without "-device virtio-blk-device,drive=hd0", the virtio block device
virtio0 is missing in dmesg:

Expected dmesg log:

  virtio_blk virtio0: 1/0/0 default/read/poll queues
  virtio_blk virtio0: [vda] 122880 512-byte logical blocks (62.9 MB/60.0 MiB)

Unlike qemu_riscv{32,64}_virt_defconfig, mmu variant doesn't use
opensbi (-bios none) and disable mmu (-cpu rv{32,64},mmu=off)
from the qemu command line...

Adding back "-device virtio-blk-device,drive=hd0" seems to help Qemu
to enable the virtio block device for nommu target.

This partially revert commit [1].

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/8233227503 (qemu_riscv32_nommu_virt_defconfig)
https://gitlab.com/buildroot.org/buildroot/-/jobs/8233227509 (qemu_riscv64_nommu_virt_defconfig)

[1] dba41736daeaf8065b44427316759e07c35545db
[2] https://gitlab.com/qemu-project/qemu/-/commit/4406ba2b5efce6af64905f827ca244f699db8170

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Julien Olivain <ju.o@free.fr>
Romain Naour 9 mesiacov pred
rodič
commit
e7cd3741b5

+ 1 - 1
board/qemu/riscv32-virt/readme.txt

@@ -2,6 +2,6 @@ Run Linux in emulation with:
 
   qemu-system-riscv32 -M virt -bios output/images/fw_jump.elf -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic # qemu_riscv32_virt_defconfig
 
-  qemu-system-riscv32 -M virt -bios none -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw -nographic -cpu rv32,mmu=off -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 # qemu_riscv32_nommu_virt_defconfig
+  qemu-system-riscv32 -M virt -bios none -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0,if=none -device virtio-blk-device,drive=hd0 -nographic -cpu rv32,mmu=off -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 # qemu_riscv32_nommu_virt_defconfig
 
 The login prompt will appear in the terminal that started Qemu.

+ 1 - 1
board/qemu/riscv64-virt/readme.txt

@@ -2,6 +2,6 @@ Run Linux in emulation with:
 
   qemu-system-riscv64 -M virt -bios output/images/fw_jump.elf -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic # qemu_riscv64_virt_defconfig
 
-  qemu-system-riscv64 -M virt -bios none -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw -nographic -cpu rv64,mmu=off -netdev user,id=net0 -device virtio-net-device,netdev=net0 # qemu_riscv64_nommu_virt_defconfig
+  qemu-system-riscv64 -M virt -bios none -kernel output/images/Image -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0,if=none -device virtio-blk-device,drive=hd0 -nographic -cpu rv64,mmu=off -netdev user,id=net0 -device virtio-net-device,netdev=net0 # qemu_riscv64_nommu_virt_defconfig
 
 The login prompt will appear in the terminal that started Qemu.