From: Alistair Francis <alistair23@gmail.com>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: "open list:RISC-V" <qemu-riscv@nongnu.org>,
Alistair Francis <alistair.francis@wdc.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [PATCH] target/riscv: Correct a comment in riscv_csrrw()
Date: Sun, 8 Aug 2021 09:21:54 +1000 [thread overview]
Message-ID: <CAKmqyKNXUrmH_54N=nV=ee6XrnrsBmok076fmrsT7d1S=zGxBw@mail.gmail.com> (raw)
In-Reply-To: <20210807141025.31808-1-bmeng.cn@gmail.com>
On Sun, Aug 8, 2021 at 12:10 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> When privilege check fails, RISCV_EXCP_ILLEGAL_INST is returned,
> not -1 (RISCV_EXCP_NONE).
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
>
> target/riscv/csr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/csr.c b/target/riscv/csr.c
> index 9a4ed18ac5..e747fbe0e9 100644
> --- a/target/riscv/csr.c
> +++ b/target/riscv/csr.c
> @@ -1423,7 +1423,7 @@ RISCVException riscv_csrrw(CPURISCVState *env, int csrno,
> target_ulong old_value;
> RISCVCPU *cpu = env_archcpu(env);
>
> - /* check privileges and return -1 if check fails */
> + /* check privileges and return RISCV_EXCP_ILLEGAL_INST if check fails */
> #if !defined(CONFIG_USER_ONLY)
> int effective_priv = env->priv;
> int read_only = get_field(csrno, 0xC00) == 3;
> --
> 2.25.1
>
>
next prev parent reply other threads:[~2021-08-07 23:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-07 14:10 [PATCH] target/riscv: Correct a comment in riscv_csrrw() Bin Meng
2021-08-07 23:21 ` Alistair Francis [this message]
2021-08-09 1:04 ` 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='CAKmqyKNXUrmH_54N=nV=ee6XrnrsBmok076fmrsT7d1S=zGxBw@mail.gmail.com' \
--to=alistair23@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=bmeng.cn@gmail.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).