All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: Alistair Francis <alistair23@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 11:34:10 +0800	[thread overview]
Message-ID: <CAEUhbmUVL3qsyxJ8OATfM9mYGSB50bMZXpVkEBRV=O8_M0Y1zA@mail.gmail.com> (raw)
In-Reply-To: <CAKmqyKNoHFfABeWqatGSzTAkPr8FZubnOMwU-rFsSj91g2f37g@mail.gmail.com>

On Fri, Nov 25, 2022 at 7:58 AM Alistair Francis <alistair23@gmail.com> wrote:
>
> 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.
>

On a screen, yes, but we can log to a file so there is no size limitation.

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

The dump routine is one of the debug methods too. If gdb stub provides
$sstatus directly I think we should do the same for dump_state for
consistency. Otherwise we can just provide $mstatus in gdb stub and
let user figure out sstatus value.

Regards,
Bin


  reply	other threads:[~2022-11-25  3:35 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
2022-11-25  3:34       ` Bin Meng [this message]
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='CAEUhbmUVL3qsyxJ8OATfM9mYGSB50bMZXpVkEBRV=O8_M0Y1zA@mail.gmail.com' \
    --to=bmeng.cn@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=alistair23@gmail.com \
    --cc=bin.meng@windriver.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 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.