[Nouveau] [PATCH 0/8] Secure Boot refactoring

Alexandre Courbot acourbot at nvidia.com
Tue Oct 11 06:45:45 UTC 2016


Hi everyone,

Apologies for the big patchset. This is a rework of the secure boot code that
moves the building of the blob into its own set of source files (and own hooks),
making the code more flexible and (hopefully) easier to understand as well.

This rework is needed to support more signed firmware for existing and new
chips. Since the firmwares in question are not available yet I cannot send the
code for them yet, but hopefully the gain in clarity will be enough to merge
this series ahead of the rest.

Patch 1 is just to make nv*_printk() more tolerent of my use of const pointers.
Patch 2 lays the foundation of a small common falcon library that could avoid
duplicated code in various parts of the driver. Right now only secure boot makes
use of it (patch 3), but there are many potential users (GR, PMU, etc). I will
test users and send further patches making use of it.

Patch 4 renames a hook to something better describing its actual use.

Patch 5 is where the big refactoring occurs. It looks scary, but is really just
moving code (and introducing the nvkm_acr structures).

Patch 6, 7 and 8 remove a few HS hooks that turn out to be unneeded, and add
support for LS hooks.

The end result can be observed by looking at acr_v1_gm20b.c: all the specifics
of GM20B's firmware are handled in a single file, with no data structures shared
with acr_v1.c. The gm20b_acr_v1_ls_func variable also describes clearly what
LS firmwares are to be loaded and how.

Alexandre Courbot (8):
  core: constify nv*_printk macros
  core: add falcon library
  secboot: use falcon library's IMEM/DMEM loading functions
  secboot: rename init() hook to oneinit()
  secboot: move ACR building logic into own source files
  secboot: remove fixup_hs_desc hook
  secboot: add low-secure firmware hooks
  secboot: generate HS BL descriptor in hook

 drm/nouveau/include/nvkm/core/client.h         |    4 +-
 drm/nouveau/include/nvkm/core/device.h         |    2 +-
 drm/nouveau/include/nvkm/core/falcon.h         |   50 +
 drm/nouveau/include/nvkm/core/subdev.h         |    2 +-
 drm/nouveau/include/nvkm/subdev/secboot.h      |   33 +-
 drm/nouveau/nvkm/core/Kbuild                   |    1 +
 drm/nouveau/nvkm/core/falcon.c                 |   62 ++
 drm/nouveau/nvkm/engine/gr/gf100.c             |   16 +-
 drm/nouveau/nvkm/engine/gr/gm200.c             |    6 +-
 drm/nouveau/nvkm/subdev/secboot/Kbuild         |    2 +
 drm/nouveau/nvkm/subdev/secboot/acr.h          |   67 ++
 drm/nouveau/nvkm/subdev/secboot/acr_v1.c       | 1193 ++++++++++++++++++++
 drm/nouveau/nvkm/subdev/secboot/acr_v1.h       |  346 ++++++
 drm/nouveau/nvkm/subdev/secboot/acr_v1_gm20b.c |  135 +++
 drm/nouveau/nvkm/subdev/secboot/base.c         |  113 +-
 drm/nouveau/nvkm/subdev/secboot/gm200.c        | 1386 +-----------------------
 drm/nouveau/nvkm/subdev/secboot/gm200.h        |   43 +
 drm/nouveau/nvkm/subdev/secboot/gm20b.c        |  141 +--
 drm/nouveau/nvkm/subdev/secboot/priv.h         |  208 +---
 19 files changed, 2072 insertions(+), 1738 deletions(-)
 create mode 100644 drm/nouveau/include/nvkm/core/falcon.h
 create mode 100644 drm/nouveau/nvkm/core/falcon.c
 create mode 100644 drm/nouveau/nvkm/subdev/secboot/acr.h
 create mode 100644 drm/nouveau/nvkm/subdev/secboot/acr_v1.c
 create mode 100644 drm/nouveau/nvkm/subdev/secboot/acr_v1.h
 create mode 100644 drm/nouveau/nvkm/subdev/secboot/acr_v1_gm20b.c
 create mode 100644 drm/nouveau/nvkm/subdev/secboot/gm200.h

-- 
2.10.0



More information about the Nouveau mailing list