lowRISC / lowRISC/opentitan

[rom_ext] switch on machine mode lockdown epmp mode (mseccfg.MML)

Aperta
#5,653 5 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Component:Software SW:ROM_EXT
Lingua principale
SystemVerilog
Stelle
3.6k
Fork
1.1k
Merge medio
2g 22h
PR unite (30g)
141

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo il codice CRT di mask ROM e la libreria ePMP, quindi esamina la documentazione ePMP collegata relativa al comportamento MML descritto qui. Determina se l'avvio esclusivamente in modalità MML è compatibile con il comportamento PMP classico previsto e aggiorna la configurazione CRT e la relativa gestione delle autorizzazioni se il progetto accetta la proposta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Ambito
security
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.