mirror of
https://github.com/xemu-project/xemu.git
synced 2025-01-21 03:16:59 +00:00
target/riscv: Dump Hypervisor registers if enabled
Dump the Hypervisor registers and the current Hypervisor state. While we are editing this code let's also dump stvec and scause. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
parent
35f690391b
commit
df30e652d4
@ -228,17 +228,50 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||
CPURISCVState *env = &cpu->env;
|
||||
int i;
|
||||
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
if (riscv_has_ext(env, RVH)) {
|
||||
qemu_fprintf(f, " %s %d\n", "V = ", riscv_cpu_virt_enabled(env));
|
||||
}
|
||||
#endif
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "pc ", env->pc);
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mhartid ", env->mhartid);
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mstatus ", env->mstatus);
|
||||
if (riscv_has_ext(env, RVH)) {
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "hstatus ", env->hstatus);
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "vsstatus ", env->vsstatus);
|
||||
}
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mip ", env->mip);
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mie ", env->mie);
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mideleg ", env->mideleg);
|
||||
if (riscv_has_ext(env, RVH)) {
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "hideleg ", env->hideleg);
|
||||
}
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "medeleg ", env->medeleg);
|
||||
if (riscv_has_ext(env, RVH)) {
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "hedeleg ", env->hedeleg);
|
||||
}
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mtvec ", env->mtvec);
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "stvec ", env->stvec);
|
||||
if (riscv_has_ext(env, RVH)) {
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "vstvec ", env->vstvec);
|
||||
}
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mepc ", env->mepc);
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "sepc ", env->sepc);
|
||||
if (riscv_has_ext(env, RVH)) {
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "vsepc ", env->vsepc);
|
||||
}
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mcause ", env->mcause);
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "scause ", env->scause);
|
||||
if (riscv_has_ext(env, RVH)) {
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "vscause ", env->vscause);
|
||||
}
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mtval ", env->mtval);
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "stval ", env->sbadaddr);
|
||||
if (riscv_has_ext(env, RVH)) {
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "htval ", env->htval);
|
||||
qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mtval2 ", env->mtval2);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user