Skip to content

Conversation

cbiffle
Copy link
Collaborator

@cbiffle cbiffle commented Sep 30, 2025

@mkeeter noticed nondeterminism in the delay loop for measurement handoff, which caused us to realize that it was being performed before the caches were set up ... which means small alignment changes in flash can have huge impact on the execution time of a tight loop.

While considering fixes, I noticed that the fix for the AXI SRAM read erratum had gradually drifted below other code. This was safe when I initially implemented it, because we weren't using AXI SRAM for kernel stack etc. at the time. We are now!

This commit moves the AXI SRAM erratum fix into pre_init where it runs before most RAM accesses, and moves cache setup earlier in system_init_custom to ensure that caches are on for the rest of the process, including measurement handoff.

@cbiffle cbiffle requested a review from mkeeter September 30, 2025 20:50
@cbiffle cbiffle enabled auto-merge (rebase) September 30, 2025 21:31
@mkeeter noticed nondeterminism in the delay loop for measurement
handoff, which caused us to realize that it was being performed _before_
the caches were set up ... which means small alignment changes in flash
can have huge impact on the execution time of a tight loop.

While considering fixes, I noticed that the fix for the AXI SRAM read
erratum had gradually drifted below other code. This was safe when I
initially implemented it, because we weren't using AXI SRAM for kernel
stack etc. at the time. We are now!

This commit moves the AXI SRAM erratum fix into pre_init where it runs
before most RAM accesses, and moves cache setup earlier in
system_init_custom to ensure that caches are on for the rest of the
process, including measurement handoff.
@cbiffle cbiffle force-pushed the cbiffle/h7-axi-sram branch from 7265904 to 59eb2de Compare September 30, 2025 21:31
@cbiffle cbiffle merged commit 2dc17d2 into master Sep 30, 2025
135 checks passed
@cbiffle cbiffle deleted the cbiffle/h7-axi-sram branch September 30, 2025 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants