On Fri, Nov 12, 2021 at 2:12 AM LIU Zhiwei <zhiwei_...@c-sky.com> wrote:
>
> Signed-off-by: LIU Zhiwei <zhiwei_...@c-sky.com>
> Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

Reviewed-by: Alistair Francis <alistair.fran...@wdc.com>

Alistair

> ---
>  target/riscv/csr.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/target/riscv/csr.c b/target/riscv/csr.c
> index 9f41954894..74c0b788fd 100644
> --- a/target/riscv/csr.c
> +++ b/target/riscv/csr.c
> @@ -1445,6 +1445,9 @@ static bool check_pm_current_disabled(CPURISCVState 
> *env, int csrno)
>      int csr_priv = get_field(csrno, 0x300);
>      int pm_current;
>
> +    if (env->debugger) {
> +        return false;
> +    }
>      /*
>       * If priv lvls differ that means we're accessing csr from higher priv 
> lvl,
>       * so allow the access
> --
> 2.25.1
>
>

Reply via email to