All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: "open list:RISC-V" <qemu-riscv@nongnu.org>,
	Bin Meng <bin.meng@windriver.com>,
	Alistair Francis <Alistair.Francis@wdc.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Xuzhou Cheng <xuzhou.cheng@windriver.com>
Subject: Re: [PATCH] target/riscv: gdbstub: Fix dynamic CSR XML generation
Date: Fri, 18 Jun 2021 16:39:22 +1000	[thread overview]
Message-ID: <CAKmqyKMwK9yNywBcoFSEKxCdhaLw9-35mD_WDiJqh6bW+gwE2A@mail.gmail.com> (raw)
In-Reply-To: <20210615085133.389887-1-bmeng.cn@gmail.com>

On Tue, Jun 15, 2021 at 6:51 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> From: Bin Meng <bin.meng@windriver.com>
>
> Since commit 605def6eeee5 ("target/riscv: Use the RISCVException enum for CSR operations")
> the CSR predicate() function was changed to return RISCV_EXCP_NONE
> instead of 0 for a valid CSR, but it forgot to update the dynamic
> CSR XML generation codes in gdbstub.
>
> Fixes: 605def6eeee5 ("target/riscv: Use the RISCVException enum for CSR operations")
> Reported-by: Xuzhou Cheng <xuzhou.cheng@windriver.com>
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> Tested-by: Xuzhou Cheng <xuzhou.cheng@windriver.com>

Thanks!

Applied to riscv-to-apply.next

Alistair

> ---
>
>  target/riscv/gdbstub.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c
> index ca78682cf4..a7a9c0b1fe 100644
> --- a/target/riscv/gdbstub.c
> +++ b/target/riscv/gdbstub.c
> @@ -170,7 +170,7 @@ static int riscv_gen_dynamic_csr_xml(CPUState *cs, int base_reg)
>
>      for (i = 0; i < CSR_TABLE_SIZE; i++) {
>          predicate = csr_ops[i].predicate;
> -        if (predicate && !predicate(env, i)) {
> +        if (predicate && (predicate(env, i) == RISCV_EXCP_NONE)) {
>              if (csr_ops[i].name) {
>                  g_string_append_printf(s, "<reg name=\"%s\"", csr_ops[i].name);
>              } else {
> --
> 2.25.1
>
>


WARNING: multiple messages have this Message-ID (diff)
From: Alistair Francis <alistair23@gmail.com>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>,
	 "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	"open list:RISC-V" <qemu-riscv@nongnu.org>,
	 Xuzhou Cheng <xuzhou.cheng@windriver.com>,
	Bin Meng <bin.meng@windriver.com>
Subject: Re: [PATCH] target/riscv: gdbstub: Fix dynamic CSR XML generation
Date: Fri, 18 Jun 2021 16:39:22 +1000	[thread overview]
Message-ID: <CAKmqyKMwK9yNywBcoFSEKxCdhaLw9-35mD_WDiJqh6bW+gwE2A@mail.gmail.com> (raw)
In-Reply-To: <20210615085133.389887-1-bmeng.cn@gmail.com>

On Tue, Jun 15, 2021 at 6:51 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> From: Bin Meng <bin.meng@windriver.com>
>
> Since commit 605def6eeee5 ("target/riscv: Use the RISCVException enum for CSR operations")
> the CSR predicate() function was changed to return RISCV_EXCP_NONE
> instead of 0 for a valid CSR, but it forgot to update the dynamic
> CSR XML generation codes in gdbstub.
>
> Fixes: 605def6eeee5 ("target/riscv: Use the RISCVException enum for CSR operations")
> Reported-by: Xuzhou Cheng <xuzhou.cheng@windriver.com>
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> Tested-by: Xuzhou Cheng <xuzhou.cheng@windriver.com>

Thanks!

Applied to riscv-to-apply.next

Alistair

> ---
>
>  target/riscv/gdbstub.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/gdbstub.c b/target/riscv/gdbstub.c
> index ca78682cf4..a7a9c0b1fe 100644
> --- a/target/riscv/gdbstub.c
> +++ b/target/riscv/gdbstub.c
> @@ -170,7 +170,7 @@ static int riscv_gen_dynamic_csr_xml(CPUState *cs, int base_reg)
>
>      for (i = 0; i < CSR_TABLE_SIZE; i++) {
>          predicate = csr_ops[i].predicate;
> -        if (predicate && !predicate(env, i)) {
> +        if (predicate && (predicate(env, i) == RISCV_EXCP_NONE)) {
>              if (csr_ops[i].name) {
>                  g_string_append_printf(s, "<reg name=\"%s\"", csr_ops[i].name);
>              } else {
> --
> 2.25.1
>
>


  parent reply	other threads:[~2021-06-18  6:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15  8:51 [PATCH] target/riscv: gdbstub: Fix dynamic CSR XML generation Bin Meng
2021-06-15  8:51 ` Bin Meng
2021-06-15 10:41 ` Alistair Francis
2021-06-15 10:41   ` Alistair Francis
2021-06-18  6:39 ` Alistair Francis [this message]
2021-06-18  6:39   ` 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=CAKmqyKMwK9yNywBcoFSEKxCdhaLw9-35mD_WDiJqh6bW+gwE2A@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=bin.meng@windriver.com \
    --cc=bmeng.cn@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=xuzhou.cheng@windriver.com \
    /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.