Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The newer version of dtc stops qemu-system-riscv64 properly executing RustSBI #46

Open
I-Rinka opened this issue Nov 15, 2022 · 1 comment

Comments

@I-Rinka
Copy link

I-Rinka commented Nov 15, 2022

I'm currently using qemu 7.0.0 for risc-v system emulation. However, the current version of device tree compiler might caught problem. If we use git clone to get the qemu source and compile it, the qemu does not work properly as it gets stuck in a loop before jumping to the kernel. The execution trace of this loop shows below. It causes RustABI in an infinite loop around address 0x80001b00:

(gdb) si
0x0000000080001b00 in ?? ()
(gdb) si
0x0000000080001b04 in ?? ()
(gdb) si
0x0000000080001b08 in ?? ()
(gdb) si
0x0000000080001b0c in ?? ()
(gdb) si
0x0000000080001b10 in ?? ()
(gdb) si
0x0000000080004394 in ?? ()
(gdb) si
0x0000000080001b14 in ?? ()
(gdb) si
0x0000000080001b18 in ?? ()
(gdb) si
0x0000000080001b00 in ?? ()
(gdb) x/10i $pc
=> 0x80001b00:	fence	w,unknown
   0x80001b04:	lb	a0,8(s1)
   0x80001b08:	fence	r,rw
   0x80001b0c:	auipc	ra,0x3
   0x80001b10:	jalr	-1912(ra)
   0x80001b14:	zext.b	a0,a0
   0x80001b18:	blez	a0,0x80001b00
   0x80001b1c:	bne	a0,s0,0x80001b26
   0x80001b20:	fence	w,unknown
   0x80001b24:	j	0x80001b04
(gdb)

I infer this problem is caused by dtc submodule is because if we download source code tar file of qemu 7.0.0 on official website, which include all of the component at that time including the full copy of old version dtc, qemu will work as expected. The only difference between the git clone version and .tar file of qemu 7.0.0 is the submodules (including dtc and a building system). I have tried many kinds of platform and it yields the same result.

@luojia65
Copy link
Member

luojia65 commented Nov 15, 2022

Hello! Looks like this issue relates to independent support package for QEMU. I'm transfering this issue to rustsbi-qemu project if proper, thanks :)

@luojia65 luojia65 transferred this issue from rustsbi/rustsbi Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants