RISC-V: crash in riscv_get_time()

Heinrich Schuchardt xypron.glpk at gmx.de
Fri Aug 7 12:53:23 CEST 2020


On 06.08.20 16:40, Bin Meng wrote:
> On Thu, Aug 6, 2020 at 10:28 PM Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>>
>> On 06.08.20 13:18, Rick Chen wrote:
>>> Hi Heinrich
>>>
>>>> From: Heinrich Schuchardt [mailto:xypron.glpk at 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 at 10000000
>>> Out:   uart at 10000000
>>> Err:   uart at 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
>>
>
> Just rebuilt a QEMU 5.0.0 on Ubuntu 16.04 and cannot reproduce.
> Something is wrong with Debian?
>
> Regards,
> Bin
>
I can confirm that with an unpatched QEMU v5.0.0 no problem occurs.
Same with QEMU 5.0.93 (v5.1.0-rc3-dirty).

Best regards

Heinrich


More information about the U-Boot mailing list