Re: [RFC PATCH 03/12] lib: sbi_hart: enforce riscv,pmwid for Worlds ISA
Pawandeep Oza <[email protected]> Mon, 13 Jul 2026 14:26:13 -0700
| Newsgroups | org.infradead.lists.opensbi |
|---|---|
| Message-ID | <CAAVgOkL1oRfEXgNot5V899LO-GjPhpbm4gOm8r2MFZw6U7i=Pg@mail.gmail.com> |
On Fri, Jun 26, 2026 at 3:16 AM Yu-Chien Peter Lin <[email protected]> wrote: > > When Smwid/Smlwid extensions are detected during hart ISA detection, > the riscv,pmwid device tree property is required to specify the M-mode > WID default value. > > Signed-off-by: Yu-Chien Peter Lin <[email protected]> > --- > lib/sbi/sbi_hart.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c > index 0c584bfc..cb0c66ea 100644 > --- a/lib/sbi/sbi_hart.c > +++ b/lib/sbi/sbi_hart.c > @@ -768,6 +768,19 @@ skip_smwiddeleg: > /* Mark hart feature detection done */ > hfeatures->detected = true; > > + /* > + * Validate M-mode WID default value: if Worlds ISA extensions > + * are present, riscv,pmwid must exist in DT. > + */ > + if ((sbi_hart_has_extension(scratch, SBI_HART_EXT_SMWID) || > + sbi_hart_has_extension(scratch, SBI_HART_EXT_SMLWID)) && > + !hfeatures->has_pmwid) { > + sbi_printf("WARNING: hart%u has Worlds ISA extension but DT " :%s/WARNING/ERROR/gc as this is causing panic/hang > + "lacks riscv,pmwid.\n", > + current_hartid()); > + return SBI_EINVAL; > + } > + > /* > * On platforms with Smepmp, the previous booting stage must > * enter OpenSBI with mseccfg.MML == 0. This allows OpenSBI > -- > 2.43.7 > > > -- > opensbi mailing list > [email protected] > http://lists.infradead.org/mailman/listinfo/opensbi -- opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi