mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-28 02:00:34 -07:00
CSR registers is import system control registers, it had better dump all CSR registers when VM is running in system mode. Here is dump output example of CSR registers: CSR000: CRMD b4 PRMD 4 EUEN 0 MISC 0 CSR004: ECFG 71c1c ESTAT 0 ERA 9000000002c31300 BADV 12022c0e0 CSR008: BADI 2b0000 CSR012: EENTRY 90000000046b0000 CSR016: TLBIDX ffffffff8e000228 TLBEHI 120228000 TLBELO0 400000016f19001f TLBELO1 400000016f1a401f CSR024: ASID a0004 PGDL 90000001016f0000 PGDH 9000000004680000 PGD 0 CSR028: PWCL 5e56e PWCH 2e4 STLBPS e RVACFG 0 CSR032: CPUID 0 PRCFG1 72f8 PRCFG2 3ffff000 PRCFG3 8073f2 CSR048: SAVE0 0 SAVE1 af9c SAVE2 12010d6a8 SAVE3 8300000 CSR052: SAVE4 0 SAVE5 0 SAVE6 0 SAVE7 0 CSR064: TID 0 TCFG 8f0ca15 TVAL 4cefd8b CNTC fffffffffe688aaa CSR068: TICLR 0 CSR096: LLBCTL 1 CSR136: TLBRENTRY 46ba000 TLBRBADV ffff8000130d81e2 TLBRERA 9000000003585cb8 TLBRSAVE ffff8000130d81e0 CSR140: TLBRELO0 1fe00043 TLBRELO1 40 TLBREHI ffff8000130d800e TLBRPRMD 0 CSR384: DMW0 8000000000000001 DMW1 9000000000000011 DMW2 0 DMW3 0 Signed-off-by: Bibo Mao <maobibo@loongson.cn> |
||
|---|---|---|
| .. | ||
| kvm | ||
| tcg | ||
| arch_dump.c | ||
| cpu-csr.h | ||
| cpu-param.h | ||
| cpu-qom.h | ||
| cpu.c | ||
| cpu.h | ||
| cpu_helper.c | ||
| csr.c | ||
| csr.h | ||
| disas.c | ||
| gdbstub.c | ||
| helper.h | ||
| insns.decode | ||
| internals.h | ||
| Kconfig | ||
| loongarch-qmp-cmds.c | ||
| machine.c | ||
| meson.build | ||
| README | ||
| trace-events | ||
| trace.h | ||
| translate.h | ||
| vec.h | ||
- Introduction
LoongArch is the general processor architecture of Loongson.
The following versions of the LoongArch core are supported
core: 3A5000
https://github.com/loongson/LoongArch-Documentation/releases/download/2021.08.17/LoongArch-Vol1-v1.00-EN.pdf
We can get the latest loongarch documents at https://github.com/loongson/LoongArch-Documentation/tags.
- System emulation
You can reference docs/system/loongarch/loongson3.rst to get the information about system emulation of LoongArch.
- Linux-user emulation
We already support Linux user emulation. We can use LoongArch cross-tools to build LoongArch executables on X86 machines,
and We can also use qemu-loongarch64 to run LoongArch executables.
1. Config cross-tools env.
see System emulation.
2. Test tests/tcg/multiarch.
./configure --static --prefix=/usr --disable-werror --target-list="loongarch64-linux-user" --enable-debug
cd build
make && make check-tcg
3. Run LoongArch system basic command with loongarch-clfs-system.
- Config clfs env.
wget https://github.com/loongson/build-tools/releases/download/2022.05.29/loongarch64-clfs-system-5.0.tar.bz2
tar -vxf loongarch64-clfs-system-5.0.tar.bz2 -C /opt/clfs
cp /opt/clfs/lib64/ld-linux-loongarch-lp64d.so.1 /lib64
export LD_LIBRARY_PATH="/opt/clfs/lib64"
- Run LoongArch system basic command.
./qemu-loongarch64 /opt/clfs/usr/bin/bash
./qemu-loongarch64 /opt/clfs/usr/bin/ls
./qemu-loongarch64 /opt/clfs/usr/bin/pwd
- Note.
We can get the latest LoongArch documents or LoongArch tools at https://github.com/loongson/