ARM-software / tf-issues

Issue tracking for the ARM Trusted Firmware project
37 stars 16 forks source link

chain-of-trust descriptor optimisations #676

Closed JoelHutton closed 5 years ago

JoelHutton commented 5 years ago

The chain-of-trust description was using a lot of memory, as it was a sparse struct array. The image descriptors contained in this array also contained arrays, which were not always used.

The first patch in the series replaces the chain of trust descriptor array with a struct pointer array, https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/657/1

The second patch changes the struct declaration (and adds casts in the assignment) to replace the arrays with pointers, allowing the uninitialised arrays to default to NULL. https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/658/1

Altogether, these patches save the following memory from bl1 and bl2 respectively, a more detailed breakdown can be seen in the commit message. bl1:-7427B, bl2:-2660B

soby-mathew commented 5 years ago

Just to note, the TF-A defines a default CoT Trust here. The platforms are allowed to override the default CoT and implement their own variant. This would break for platforms which have their own CoT and they would need to migrate to the new structure. This should be fairly easy to do and would have significant memory savings.

soby-mathew commented 5 years ago

The patch-set is currently undergoing review. Please let us know if there are any comments for this change.

soby-mathew commented 5 years ago

Edited the description to point to trustedfirmware.org gerrit links.

sandrine-bailleux-arm commented 5 years ago

Both patches (here and here) have now been merged.