All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target/riscv: Correct a comment in riscv_csrrw()
@ 2021-08-07 14:10 Bin Meng
  2021-08-07 23:21   ` Alistair Francis
  2021-08-09  1:04   ` Alistair Francis
  0 siblings, 2 replies; 5+ messages in thread
From: Bin Meng @ 2021-08-07 14:10 UTC (permalink / raw)
  To: Alistair Francis, qemu-devel, qemu-riscv

When privilege check fails, RISCV_EXCP_ILLEGAL_INST is returned,
not -1 (RISCV_EXCP_NONE).

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] target/riscv: Correct a comment in riscv_csrrw()
  2021-08-07 14:10 [PATCH] target/riscv: Correct a comment in riscv_csrrw() Bin Meng
@ 2021-08-07 23:21   ` Alistair Francis
  2021-08-09  1:04   ` Alistair Francis
  1 sibling, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2021-08-07 23:21 UTC (permalink / raw)
  To: Bin Meng
  Cc: open list:RISC-V, Alistair Francis, qemu-devel@nongnu.org Developers

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
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] target/riscv: Correct a comment in riscv_csrrw()
@ 2021-08-07 23:21   ` Alistair Francis
  0 siblings, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2021-08-07 23:21 UTC (permalink / raw)
  To: Bin Meng
  Cc: Alistair Francis, qemu-devel@nongnu.org Developers, open list:RISC-V

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
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] target/riscv: Correct a comment in riscv_csrrw()
  2021-08-07 14:10 [PATCH] target/riscv: Correct a comment in riscv_csrrw() Bin Meng
@ 2021-08-09  1:04   ` Alistair Francis
  2021-08-09  1:04   ` Alistair Francis
  1 sibling, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2021-08-09  1:04 UTC (permalink / raw)
  To: Bin Meng
  Cc: open list:RISC-V, Alistair Francis, qemu-devel@nongnu.org Developers

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>

Thanks!

Applied to riscv-to-apply.next

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
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] target/riscv: Correct a comment in riscv_csrrw()
@ 2021-08-09  1:04   ` Alistair Francis
  0 siblings, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2021-08-09  1:04 UTC (permalink / raw)
  To: Bin Meng
  Cc: Alistair Francis, qemu-devel@nongnu.org Developers, open list:RISC-V

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>

Thanks!

Applied to riscv-to-apply.next

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
>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-09  1:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-07 14:10 [PATCH] target/riscv: Correct a comment in riscv_csrrw() Bin Meng
2021-08-07 23:21 ` Alistair Francis
2021-08-07 23:21   ` Alistair Francis
2021-08-09  1:04 ` Alistair Francis
2021-08-09  1:04   ` Alistair Francis

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.