[PATCH 7/8] lib: sbi_hart: add Ssstateen extension
Anup Patel
apatel at ventanamicro.com
Mon Apr 28 22:30:02 PDT 2025
On Mon, Apr 28, 2025 at 7:25 PM Radim Krčmář <rkrcmar at ventanamicro.com> wrote:
>
> 2025-04-28T18:08:12+05:30, Anup Patel <anup at brainfault.org>:
> > On Tue, Apr 15, 2025 at 8:13 PM Radim Krčmář <rkrcmar at ventanamicro.com> wrote:
> >>
> >> We already detect Smstateen, but Ssstateen exists as well and it doesn't
> >> have the M-state CSRs.
> >>
> >> Signed-off-by: Radim Krčmář <rkrcmar at ventanamicro.com>
> >> ---
> >> diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h
> >> @@ -31,7 +31,7 @@ enum sbi_hart_extensions {
> >> SBI_HART_EXT_SMAIA = 0,
> >> /** HART has Smepmp */
> >> SBI_HART_EXT_SMEPMP,
> >> - /** HART has Smstateen CSR **/
> >> + /** HART has mstateen*, sstateen*, and hstateen* CSRs **/
> >
> > Let's not define what Smstateen means here.
> >
> > Smstateen implies only mstateen CSRs whereas
> > Sstateeen implies [h|s]stateen CSRs.
>
> The spec actually says that Smstateen is all of the CSRs and Sstateeen
> misses mstateen*, but yeah, it's not that important...
>
> Can I remove the comments instead?
I suggest keeping the comment as-is to be consistent
with other enum values.
>
> SBI_HART_EXT_SMSTATEEN is obviously Smstateen, so I don't see the point
> of the comment.
>
Since Smstateen cover Ssstateen as well, I suggest
SBI_HART_EXT_SMSTATEEN should imply
SBI_HART_EXT_SSSTATEEN
Regards,
Anup
More information about the opensbi
mailing list