* [PATCH] target/riscv: Dump CSR mscratch/sscratch/satp
@ 2021-04-28 12:25 Changbin Du
2021-05-13 0:18 ` Alistair Francis
2021-05-14 3:18 ` Bin Meng
0 siblings, 2 replies; 5+ messages in thread
From: Changbin Du @ 2021-04-28 12:25 UTC (permalink / raw)
To: Palmer Dabbelt, Alistair Francis, Sagar Karandikar, Bastian Koppelmann
Cc: qemu-riscv, qemu-devel, Changbin Du
This dumps the CSR mscratch/sscratch/satp and meanwhile aligns
the output of CSR mtval/stval.
Signed-off-by: Changbin Du <changbin.du@gmail.com>
---
target/riscv/cpu.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 7d6ed80f6b67..73af6f5445ba 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -281,12 +281,15 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)
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);
+ 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);
}
+ qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mscratch", env->mscratch);
+ qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "sscratch", env->sscratch);
+ qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "satp ", env->satp);
#endif
for (i = 0; i < 32; i++) {
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] target/riscv: Dump CSR mscratch/sscratch/satp
2021-04-28 12:25 [PATCH] target/riscv: Dump CSR mscratch/sscratch/satp Changbin Du
@ 2021-05-13 0:18 ` Alistair Francis
2021-05-14 3:18 ` Bin Meng
1 sibling, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2021-05-13 0:18 UTC (permalink / raw)
To: Changbin Du
Cc: open list:RISC-V, Sagar Karandikar, Bastian Koppelmann,
qemu-devel@nongnu.org Developers, Alistair Francis,
Palmer Dabbelt
On Wed, Apr 28, 2021 at 10:29 PM Changbin Du <changbin.du@gmail.com> wrote:
>
> This dumps the CSR mscratch/sscratch/satp and meanwhile aligns
> the output of CSR mtval/stval.
>
> Signed-off-by: Changbin Du <changbin.du@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> target/riscv/cpu.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index 7d6ed80f6b67..73af6f5445ba 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -281,12 +281,15 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)
> 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);
> + 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);
> }
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mscratch", env->mscratch);
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "sscratch", env->sscratch);
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "satp ", env->satp);
> #endif
>
> for (i = 0; i < 32; i++) {
> --
> 2.27.0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] target/riscv: Dump CSR mscratch/sscratch/satp
@ 2021-05-13 0:18 ` Alistair Francis
0 siblings, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2021-05-13 0:18 UTC (permalink / raw)
To: Changbin Du
Cc: Palmer Dabbelt, Alistair Francis, Sagar Karandikar,
Bastian Koppelmann, open list:RISC-V,
qemu-devel@nongnu.org Developers
On Wed, Apr 28, 2021 at 10:29 PM Changbin Du <changbin.du@gmail.com> wrote:
>
> This dumps the CSR mscratch/sscratch/satp and meanwhile aligns
> the output of CSR mtval/stval.
>
> Signed-off-by: Changbin Du <changbin.du@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> target/riscv/cpu.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index 7d6ed80f6b67..73af6f5445ba 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -281,12 +281,15 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)
> 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);
> + 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);
> }
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mscratch", env->mscratch);
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "sscratch", env->sscratch);
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "satp ", env->satp);
> #endif
>
> for (i = 0; i < 32; i++) {
> --
> 2.27.0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] target/riscv: Dump CSR mscratch/sscratch/satp
2021-04-28 12:25 [PATCH] target/riscv: Dump CSR mscratch/sscratch/satp Changbin Du
@ 2021-05-14 3:18 ` Bin Meng
2021-05-14 3:18 ` Bin Meng
1 sibling, 0 replies; 5+ messages in thread
From: Bin Meng @ 2021-05-14 3:18 UTC (permalink / raw)
To: Changbin Du
Cc: open list:RISC-V, Sagar Karandikar, Bastian Koppelmann,
qemu-devel@nongnu.org Developers, Alistair Francis,
Palmer Dabbelt
On Wed, Apr 28, 2021 at 8:29 PM Changbin Du <changbin.du@gmail.com> wrote:
>
> This dumps the CSR mscratch/sscratch/satp and meanwhile aligns
> the output of CSR mtval/stval.
>
> Signed-off-by: Changbin Du <changbin.du@gmail.com>
> ---
> target/riscv/cpu.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index 7d6ed80f6b67..73af6f5445ba 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -281,12 +281,15 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)
> 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);
> + 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);
I believe you also need some alignment for these 2
> }
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mscratch", env->mscratch);
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "sscratch", env->sscratch);
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "satp ", env->satp);
> #endif
>
> for (i = 0; i < 32; i++) {
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] target/riscv: Dump CSR mscratch/sscratch/satp
@ 2021-05-14 3:18 ` Bin Meng
0 siblings, 0 replies; 5+ messages in thread
From: Bin Meng @ 2021-05-14 3:18 UTC (permalink / raw)
To: Changbin Du
Cc: Palmer Dabbelt, Alistair Francis, Sagar Karandikar,
Bastian Koppelmann, open list:RISC-V,
qemu-devel@nongnu.org Developers
On Wed, Apr 28, 2021 at 8:29 PM Changbin Du <changbin.du@gmail.com> wrote:
>
> This dumps the CSR mscratch/sscratch/satp and meanwhile aligns
> the output of CSR mtval/stval.
>
> Signed-off-by: Changbin Du <changbin.du@gmail.com>
> ---
> target/riscv/cpu.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index 7d6ed80f6b67..73af6f5445ba 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -281,12 +281,15 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)
> 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);
> + 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);
I believe you also need some alignment for these 2
> }
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mscratch", env->mscratch);
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "sscratch", env->sscratch);
> + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "satp ", env->satp);
> #endif
>
> for (i = 0; i < 32; i++) {
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-05-14 3:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 12:25 [PATCH] target/riscv: Dump CSR mscratch/sscratch/satp Changbin Du
2021-05-13 0:18 ` Alistair Francis
2021-05-13 0:18 ` Alistair Francis
2021-05-14 3:18 ` Bin Meng
2021-05-14 3:18 ` Bin Meng
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.