You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR implements RFD 568: SP resets and
measurement (https://rfd.shared.oxide.computer/rfd/0568)
The goal of the RFD is to solve the cold boot problem, where the RoT
takes several seconds to start, but must measure the SP at reset. For
reasons described in the RFD, we choose to have the SP reset itself at
startup, giving the RoT a chance to catch it. More specifically:
- The RoT can detect an SP reset, hold it in reset, and measure it.
After measuring it, the RoT deposits a token at a particular location in
the SP's RAM.
- When the SP boots, it checks for this token. If the token is present,
then it continues booting. Otherwise, it sleeps for a little while, then
resets itself. This occurs a limited number of times; if we exceed a
maximum retry count, then the SP continues to boot, feeling vaguely
guilty about not having been measured.
Together, these changes mean that if we power on a system, the SP will
reset itself about about 12 times over the course of 2.5 seconds (with
200ms pauses in between) before the RoT boots up. It will then be
measured by the RoT, and continue to boot normally. If the RoT isn't
present, the SP stops resetting after about 4 seconds (20 resets).
There are a bunch of changes to make this possible!
- The `kernel` now knows about `extern-region`s and generates `BASE` /
`END` symbols in its linker script. This lets us specify a `handoff`
region from which it reads the tokens. Unfortunately, this address has
to be hard-coded in the RoT, since the RoT doesn't have a way of
determining its location from the SP.
- I refactored `lpc55-swd` to extract `reset_into_debug_halt` into a
standalone function, because it's now used for both measurements and to
reset the SP before depositing the token into memory. There are various
other cleanups here; in particular, I removed the stateful `Undo`
bitfield in favor of smaller functions which cleaning up before
returning.
0 commit comments