adoptium / infrastructure

This repo contains all information about machine maintenance.
Apache License 2.0
86 stars 101 forks source link

Use -M sifive_u instead of -M virt for RISC-V qemu checks #2100

Open sxa opened 3 years ago

sxa commented 3 years ago

At the moment the -M virt type used in qemuPlaybookCheck for RISC-V VMs only seems to be operating as a single-core machine. From what I can tell if we were able to use -M sifive_u or -M microchip-icicle-kit then we'd be able to get up to 5 cores available which would be more useful.

Willsparker commented 3 years ago

I need to install QEMU on my laptop to get this to work. For the best chances that changing the machine works, I'm going to install QEMU 6.0, not 5.0 thats on infra-ibmcloud-vagrant-x64-*. I'll document the errors I run into when building it, here, so I can update the vagrant.yml playbook, too.

Willsparker commented 3 years ago

Dependencies: Since QEMU 5.2, ninja-build is apparently required to build QEMU. Others installed were listed at https://wiki.qemu.org/Hosts/Linux#Fedora_Linux_.2F_Debian_GNU_Linux_.2F_Ubuntu_Linux_.2F_Linux_Mint_distributions

Willsparker commented 3 years ago

Once building (which took about an hour for me), make install runs and I can use qemu-system-riscv64.

Willsparker commented 3 years ago

Having installed opensbi and u-boot-qemu, I get the following error message:

will@will-XPS-13-9360:~/Documents/2100$ qemu-system-riscv64 -smp 2 -m 3072 -M virt -device virtio-net-device,netdev=net -netdev user,id=net,hostfwd=tcp::10022-:22 -device virtio-blk-device,drive=hd -drive file=DEBIAN11.RISCV.dsk,if=none,id=hd -kernel /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf -device loader,file=/usr/lib/u-boot/qemu-riscv64_smode/u-boot.bin,addr=0x80200000 -nographic
qemu-system-riscv64: Some ROM regions are overlapping
These ROM regions might have been loaded by direct user request or by default.
They could be BIOS/firmware images, a guest kernel, initrd or some other file loaded into guest memory.
Check whether you intended to load all this guest code, and whether it has been built to load to the correct addresses.

The following two regions overlap (in the memory address space):
  /usr/local/bin/../share/qemu/opensbi-riscv64-generic-fw_dynamic.bin (addresses 0x0000000080000000 - 0x0000000080012558)
  /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf ELF program header segment 0 (addresses 0x0000000080000000 - 0x0000000080016ce8)

I think this may be due to me installing u-boot-qemu at version 2021.01+dfsg-4, whereas the machine running QPC has version 2021.01+dfsg-2, as the opensbi version is the same. Unfortunately, 2021.01+dfsg-4 is the only version available.

Willsparker commented 3 years ago

I now believe this may be due to using QEMU-6.0, as the /usr/local/bin/../share/qemu/opensbi-riscv64-generic-fw_dynamic.bin comes from the QEMU installation. So I'll try with QEMU 5.1.

Willsparker commented 3 years ago

Same issue with QEMU 5.1 ... I guess I'll just do it on infra-ibmcloud-vagrant-x64-1 ..