
On 06.08.20 13:18, Rick Chen wrote:
Hi Heinrich
From: Heinrich Schuchardt [mailto:xypron.glpk@gmx.de] Sent: Thursday, August 06, 2020 6:45 PM To: Bin Meng; Rick Jian-Zhi Chen(陳建志) Cc: U-Boot Mailing List Subject: RISC-V: crash in riscv_get_time()
Hello Rick, hello Bin,
when I run qemu-riscv64_defconfig using
qemu-system-riscv64 -machine virt -m 1G -nographic \ -bios u-boot \ -device virtio-net-device,netdev=net0 \ -netdev user,id=net0,tftp=tftp
a crash occurs in riscv_get_time() when executing readq().
$ qemu-system-riscv64 --version QEMU emulator version 5.0.0 (Debian 1:5.0-13)
Looking at doc/board/emulation/qemu-riscv.rst this should work.
Is there something missing in the documentation?
You can try this ./qemu-system-riscv64 -nographic -machine virt -bios u-boot -device virtio-net-device,netdev=net0 -netdev user,id=net0,tftp=tftp
It can work as below:
U-Boot 2020.10-rc1-00299-g89150a9 (Aug 06 2020 - 19:14:01 +0800)
CPU: rv64imafdcsu Model: riscv-virtio,qemu DRAM: 128 MiB In: uart@10000000 Out: uart@10000000 Err: uart@10000000 Net: eth0: virtio-net#0 Hit any key to stop autoboot: 0 => help
But on Debian Bullseye it fails:
$ git reset --hard origin/master $ make mrproper $ make qemu-riscv64_defconfig $ export CROSS_COMPILE $ export CROSS_COMPILE=riscv64-linux-gnu- $ qemu-system-riscv64 -nographic -machine virt \
-bios u-boot \ -device virtio-net-device,netdev=net0 \ -netdev user,id=net0,tftp=tftp
U-Boot 2020.10-rc1-00120-g1521326b7a (Aug 06 2020 - 16:17:14 +0200)
CPU: rv64imafdcsu Model: riscv-virtio,qemu DRAM: 128 MiB In: uart@10000000 Out: uart@10000000 Err: uart@10000000 Net: eth0: virtio-net#0 Hit any key to stop autoboot: 2 Unhandled exception: Load access fault EPC: 0000000087f6e282 TVAL: 000000000200bff8 ### ERROR ### Please RESET the board ###
Debian uses QEMU 5. QEMU emulator version 5.0.0 (Debian 1:5.0-13)
The QEMU in our Dockerimage used for Gitlab is QEMU emulator version 4.2.0 (v4.2.0-dirty)
With this outdated QEMU the emulation succeeds.
Our testing should succeed on current QEMU.
Best regards
Heinrich