CSR registers is import system control registers, it had better to dump all CSR registers when VM is running in system mode, rather than dump part of those, since guest OS uses these CSR registers. And it is very useful to debug guest OS.
--- v2 .. v3: 1. Split patch into smaller in order to review. 2. Adjust CSR register output format, align CSR register name with six bytes at most. v1 .. v2: 1. Fix compiling issue on user mode only emulation 2. Add flag to present unused CSR register for LA464 CPU 3. Add human friendly output format, CSR register output is aligned. --- Bibo Mao (7): target/loongarch: Add dynamic function access with CSR register target/loongarch: Remove static CSR function setting target/loongarch: Add generic csr function type target/loongarch: Add common header file for CSR registers target/loongarch: Add common source file for CSR register target/loongarch: Set unused flag with CSR registers target/loongarch: Dump all generic CSR registers target/loongarch/cpu.c | 95 +++++++++-- target/loongarch/csr.c | 129 ++++++++++++++ target/loongarch/csr.h | 29 ++++ target/loongarch/meson.build | 1 + .../tcg/insn_trans/trans_privileged.c.inc | 161 +++++------------- target/loongarch/tcg/tcg_loongarch.h | 12 ++ target/loongarch/tcg/translate.c | 5 + 7 files changed, 293 insertions(+), 139 deletions(-) create mode 100644 target/loongarch/csr.c create mode 100644 target/loongarch/csr.h create mode 100644 target/loongarch/tcg/tcg_loongarch.h base-commit: d6430c17d7113d3c38480dc34e59d00b0504e2f7 -- 2.39.3