Hi Jens,
Thanks for the feedback.
See inline [OD]
Regards, Olivier.
________________________________________ From: Jens Wiklander jens.wiklander@linaro.org Sent: 14 November 2023 08:56 To: Olivier Deprez Cc: hafnium@lists.trustedfirmware.org Subject: Re: [Hafnium] scaling platform's spmc build
Hi Olivier,
This is useful. I have a few questions below.
On Mon, Nov 13, 2023 at 1:38 PM Olivier Deprez via Hafnium hafnium@lists.trustedfirmware.org wrote:
Hi,
As of today, the way to build Hafnium is a single make command to build Hafnium binaries (e.g. SPMC) and tests for all platforms at once. This is an overhead for deployments or integrations downstream that are only interested in building a single platform SPMC image, and are not interested in running Hafnium tests.
We have a proposal to help scaling to those deployments where only an SPMC binary for a given platform is required. On the benefits side, this greatly decreases the build time for said deployments and limits build dependencies (e.g. ones within the test framework).
Regarding "limits build dependencies", does that mean that some of the git submodules will not be needed when building for a specific target, for instance, secure_qemu_aarch64?
In our CI builds we all gits from scratch each time so if it's possible to skip some git submodules it could save some time.
[OD] I see what you mean, but no this change doesn't address this problem (we're discussing how to improve it internally though). By limiting dependencies, I was relating about https://hafnium.readthedocs.io/en/latest/getting_started/prerequisites.html#... where I'm assuming a number of host packages are required for building the test infrastructure but not required for just building a single hafnium SPMC image. I did not do the exercise of stripping down this list though.
On a related note, we still have on our radar to remove the clang toolchain from the prebuilts submodule (would save 1.5GB while cloning). It takes time as there are dependencies to this old toolchain into downstream CIs. It'd be great if you could switch to the recommended clang15 (https://hafnium.readthedocs.io/en/latest/getting_started/prerequisites.html#...) for the Hafnium/OPTEE/qemu setup.
There are certainly more complex solutions that we thought about (like segregating individual project git trees beyond 'reference') . However, the proposed change remains simple and keeps the build system backwards compatible with existing deployments.
Essentially this introduces a PLATFORM command line build option for the sake of building the SPMC for one given platform (omitting tests). If required it can be combined with the existing PROJECT variable.
Example usages:
- make [PROJECT=reference] : builds all platforms from 'reference' project including tests (same as today)
- make PLATFORM=secure_aem_v8a_fvp_vhe : builds the SPMC targeting FVP from the 'reference' project (omitting tests)
Similarly for Arm solutions, make PLATFORM=secure_tc, make PLATFORM=secure_rd_fremont
make PROJECT=project1 : make all platforms from alternate project 'project1'
make PROJECT=project2 PLATFORM=platform1 : make a single 'platform1' hafnium binary from project 'project2'
See the changes:
https://review.trustedfirmware.org/c/hafnium/hafnium/+/24822 https://review.trustedfirmware.org/c/hafnium/project/reference/+/24821/
Let us know if the approach sounds reasonable.
Seems easy to use.
Thanks, Jens
Regards, Olivier.
-- Hafnium mailing list -- hafnium@lists.trustedfirmware.org To unsubscribe send an email to hafnium-leave@lists.trustedfirmware.org