[rom_ext] switch on machine mode lockdown epmp mode (mseccfg.MML)
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- SystemVerilog
- Sterne
- 3.6k
- Forks
- 1.1k
- Ø Merge
- 2 T. 22 Std.
- Gemergte PRs (30 T.)
- 141
Beschreibung
This a proposal to switch on machine mode lockdown (MML) during CRT in the mask ROM. Machine mode lockdown is described in more detail here: https://ibex-core.readthedocs.io/en/latest/_downloads/adbc55b5b9bad5f92968b58e7b12fc57/riscv-epmp.pdf. Enabling MML in the mask ROM would have two main advantages:
* Enabled but unlocked (i.e. `A != OFF` and `L = 0`) entries would no longer confer full read-write-execute access in machine mode. The ePMP library will already prevent this in software but having the hardware do it too seems beneficial, especially since some entries will be configured in assembly. MML makes it impossible to have regions that are both simultaneously writable and executable.
* Machine mode lockdown is sticky (once set cannot be unset) and so the whole system would only ever be using a single memory protection scheme. There would be no need to consider how a transition from 'classic' PMP mode into MML would affect existing entries.
There are however some disadvantages:
* If this proposal is accepted it will mean that the system cannot be booted into 'classic' PMP mode. This could have software compatibility implications. Although the proposed use of the machine mode whitelisting policy (MMWP) feature during boot would technically already break full compatibility anyway.
* The meaning of permissions is no longer quite as simple and may require looking up in a table. In practice all of the permissions combinations that are likely to be required during boot are still self explanatory though so I don't think this is a significant problem. The permissions exposed by the ePMP library will be almost the same, in fact the only change would be that the `Unlocked` value representing `L=0 R=0 W=0 X=0` would be replaced by a proper `UnlockedNoAccess` value representing the same permission bits.
Overall I think that we should enable MML in the mask ROM CRT code _unless_ we want to be able to boot into 'classic' PMP mode.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den mask ROM CRT-Code und die ePMP-Bibliothek zu lesen, und prüfe anschließend die verknüpfte ePMP-Dokumentation zum hier beschriebenen MML-Verhalten. Ermittle, ob das Booten ausschließlich im MML-Modus mit dem vorgesehenen klassischen PMP-Verhalten kompatibel ist, und aktualisiere die CRT-Konfiguration sowie die zugehörige Berechtigungsbehandlung, falls das Projekt den Vorschlag annimmt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Bereich
- security
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100