On Thu, Nov 20, 2025 at 08:30:50AM -0300, Daniel Henrique Barboza wrote:
[snip]
> > diff --git a/target/riscv/csr.c b/target/riscv/csr.c
> > index 5c91658c3dc4..06a6212c672d 100644
> > --- a/target/riscv/csr.c
> > +++ b/target/riscv/csr.c
> > @@ -1759,6 +1759,37 @@ static RISCVException write_stimecmph(CPURISCVState 
> > *env, int csrno,
> >       return RISCV_EXCP_NONE;
> >   }
> > +static RISCVException check_srmcfg(CPURISCVState *env, int csrno)
> > +{
> > +    RISCVCPU *cpu = env_archcpu(env);
> > +
> > +    if (!cpu->cfg.ext_ssqosid) {
> > +        return RISCV_EXCP_ILLEGAL_INST;
> > +    }
> 
> env_archcpu() is a bit heavyweight and we usually avoid it. Since you're 
> using the 'cpu' ptr
> solely to access the CFG pointer I suggest using riscv_cpu_cfg() instead:
> 
> if (!riscv_cpu_cfg(env)->ext_ssqosid) {...}

Thanks for letting me know. I will change to riscv_cpu_cfg() in the next
revision.

Drew

Reply via email to