[PATCH] lib: sbi/hart: preserve csr validation value.

Dmitry Dunaev dunaich at mail.ru
Thu Apr 14 00:56:33 PDT 2022


> > The OpenSBI hart init function hart_detect_features() try to read
> > important CSRs but reasign the last read value to the variable that
> > initially contains write probe value. So for series of CSRs (like
> > PMPADDRx) the secong CSR probe value will became the initial value
of
> > first probing CSR. To avoid of this issue the CSR read value should
be
> > saved in different variable. In this configuration the count of PMP
> > will detect rightly if any PMPADDR is hardwired to zero.
> >  
> > Signed-off-by: Dmitry Dunaev <dunaich at mail.ru>
> only change name from val to oldval?

It is important to have two variables. The 'val' which is contains the
probe value and 'oldval' which value will be changed each time when we
probe the CSR (the value which will restored in probed CSR).

> 
> Regards,
> Xiang W

BW, Dmitry





More information about the opensbi mailing list