qspi: use FPGA hashing for host-flash programming

Abierto
#2,789 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
15/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
3.7k
Forks
246
Merge medio
2 d 11 min
PR fusionados (30 d)
27

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de oxidecomputer/hubris

Todos los issues de oxidecomputer/hubris

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.