qspi: use FPGA hashing for host-flash programming

Aperta
#2,789 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start in the humility qspi -D path that currently reads sectors through the FPGA, hashes them in firmware, and reports over hiffy, then compare it with the FPGA hash block driver and the host-side check in humility. The caveats to resolve first are FPGA hash-block arbitration with the host, swapping the -D digest to SHA3-256 via the off-the-shelf crate, and keeping gimlet/cosmo boards on the old path. Done means qspi -D uses FPGA hashing where available and still produces identical skip decisions on boards without it. Note the author already has a PoC.

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

Descrizione

Today's humility qspi -D avoids erasing + writing sectors that don't need to change by hashing the contents in firmware, and checking it against the values calculated by humility.

This involves reading through the FPGA, hashing in firmware, and reporting that over hiffy.

We could instead ask the FPGA to just directly hash the chunks for us, because it is much faster! We could even use this hashing to check if entire ranges are already erased.

There are some caveats to this:

  1. There is only one FPGA hash block available, and we share it with the host. We'd need to make sure the host is in A2, or otherwise ensure we're not competing for the resource.
  2. The FPGA hash is a different algorithm than we currently use for the -D hashing. There is an "off the shelf" rust crate that implements the SHA3-256 that we can use.
  3. Humility would need to stay compatible with existing gimlet/cosmo boards that can't/don't use the FPGA for hashing.

I have a PoC that does this, and it stands to save us 20s-ish out of a 2m15s humility qspi -D call. For now, it didn't seem like a good tradeoff, but it is potentially an option to reconsider in the future.

Lingua principale
Rust
Stelle
3.7k
Fork
246
Merge medio
2g 11m
PR unite (30g)
27

Preparare l'ambiente

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.

Altre issue di oxidecomputer/hubris

Tutte le issue di oxidecomputer/hubris

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.