[PATCH v5 4/9] lib: sbi_hart: lock mwid CSR for RoT immutability
Yu-Chien Peter Lin
peter.lin at sifive.com
Tue Nov 17 20:55:37 PST 2026
> Thanks for the suggestion. I'd prefer lock-only, because writing pmwid before the
> lock is either a no-op or can undo an earlier stage's decision.
>
> The spec says "On-reset, the mwid CSR is expected to show the platform-defined pmwid
> value", so if OpenSBI is the first stage, mwid already equals pmwid and the write
> changes nothing.
>
> It only changes something when mwid != pmwid, which means an earlier stage has already
> programmed mwid. Example with nWorlds=16, trusted WID = 15:
For context, wgChecker MMIO must be accessed with the trusted WID,
which is held by the trusted agent. The trusted agent can be the
application processor's M-mode or a dedicated secure control core.
More information about the opensbi
mailing list