qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: Bin Meng <bmeng@tinylab.org>,
	qemu-devel@nongnu.org,
	 Alistair Francis <alistair.francis@wdc.com>,
	Bin Meng <bin.meng@windriver.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	qemu-riscv@nongnu.org
Subject: Re: [PATCH] target/riscv: Dump sstatus CSR in riscv_cpu_dump_state()
Date: Fri, 25 Nov 2022 09:57:34 +1000	[thread overview]
Message-ID: <CAKmqyKNoHFfABeWqatGSzTAkPr8FZubnOMwU-rFsSj91g2f37g@mail.gmail.com> (raw)
In-Reply-To: <CAEUhbmXFwhpFv=PwEJBfYsbiViuB=GE_4r6MCjfBQ+UpHgkhqA@mail.gmail.com>

On Wed, Nov 23, 2022 at 2:07 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Alistair,
>
> On Wed, Nov 23, 2022 at 8:03 AM Alistair Francis <alistair23@gmail.com> wrote:
> >
> > On Wed, Nov 23, 2022 at 2:07 AM Bin Meng <bmeng@tinylab.org> wrote:
> > >
> > > sstatus register dump is currently missing in riscv_cpu_dump_state().
> > >
> > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1332
> > > Signed-off-by: Bin Meng <bmeng@tinylab.org>
> > >
> > > ---
> > >
> > >  target/riscv/cpu.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> > > index d14e95c9dc..80d76f0181 100644
> > > --- a/target/riscv/cpu.c
> > > +++ b/target/riscv/cpu.c
> > > @@ -382,6 +382,7 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)
> > >              CSR_MHARTID,
> > >              CSR_MSTATUS,
> > >              CSR_MSTATUSH,
> > > +            CSR_SSTATUS,
> >
> > I don't think we need this. mstatus contains all of the information
> > already and there is limited space to print all of this information
> > out.
> >
>
> I am not sure what limited space restricts this? This is CPU state
> dump, and printing sstatus CSR seems reasonable to me. We do the
> similar thing in the gdb stub too.

Limited space in that there is only so much text we want to dump to
the screen. As new extensions are added this will continue to grow,
and sstatus doesn't provide any more information then the mstatus
register that we already show.

GDB is a little different as people can interactively probe the
registers they are interested in.

Alistair

>
> Regards,
> Bin


  reply	other threads:[~2022-11-24 23:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 15:46 [PATCH] target/riscv: Dump sstatus CSR in riscv_cpu_dump_state() Bin Meng
2022-11-23  0:02 ` Alistair Francis
2022-11-23  4:07   ` Bin Meng
2022-11-24 23:57     ` Alistair Francis [this message]
2022-11-25  3:34       ` Bin Meng
2022-11-25  4:32         ` Alistair Francis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKmqyKNoHFfABeWqatGSzTAkPr8FZubnOMwU-rFsSj91g2f37g@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=bin.meng@windriver.com \
    --cc=bmeng.cn@gmail.com \
    --cc=bmeng@tinylab.org \
    --cc=palmer@dabbelt.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).