| 509a9802 | 01-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add support for compressed early TAs
Add decompression code to the early TA loader and update the Python script accordingly. The compression algorithm is "deflate", which is used by zlib and gzip in
Add support for compressed early TAs
Add decompression code to the early TA loader and update the Python script accordingly. The compression algorithm is "deflate", which is used by zlib and gzip in particular. It allows for compression ratios comprised between 3 (for bigger TAs) and 4.7 (for smaller ones). Those numbers were observed with 32-bit TAs (QEMU).
On QEMU (armv7), the code size overhead when CFG_EARLY_TA=y, including the decompressor, is 12K when DEBUG=0 or 20K when DEBUG=1. The decompressor allocates about 39K of heap.
Another library compatible with zlib was tried for comparison [1]. The code size overhead with miniz was 8K (DEBUG=0) or 16K (DEBUG=1). On the other hand, the dynamic allocation was about 43K, so the total memory required was about same. Speed was not compared. In the end, zlib was preferred for licensing reasons and because it is widely used.
Link: [1] https://github.com/richgel999/miniz Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMUv8, pager) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (D02 32/64 bits) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (D02 32/64 bits, pager) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|