Commit graph

15665 commits

Author SHA1 Message Date
Ziad Elhanafy
428f4169ab docs(rd1ae): update documentation to include BL32
Update the boot sequence in the RD-1 AE documentation
to include BL32 (OP-TEE).

Signed-off-by: Ziad Elhanafy <ziad.elhanafy@arm.com>
Change-Id: I25fdc114bb71d3ad7e1bb2d845f758d6af037e3d
2024-11-29 10:17:47 +00:00
Ziad Elhanafy
8b27eb7d91 feat(rd1ae): add support for OP-TEE SPMC
Add support for loading and booting OP-TEE as SPMC running at
S-EL1 for RD-1 AE platform.

Signed-off-by: Ziad Elhanafy <ziad.elhanafy@arm.com>
Change-Id: If29f56bb19fe7f370208ef5a6f60bfff4346ea93
2024-11-14 13:56:39 +00:00
Govindraj Raja
3109367c34 Merge "fix(build): ensure $(ROT_KEY) depends on correct directory rules" into integration 2024-11-12 16:39:40 +01:00
Chris Kay
7a95759f93 fix(build): ensure $(ROT_KEY) depends on correct directory rules
In order for directories to be automatically created when used as a
dependency, they must end with a forward slash (`/`). This is because we
have a pattern rule (`%/`) to create a directory anywhere where a
directory is required as a direct dependency.

Change-Id: Ib632d59da0745f6cadb0a839a62360aeca25c178
Signed-off-by: Chris Kay <chris.kay@arm.com>
2024-11-12 12:50:45 +00:00
Manish V Badarkhe
dc5d485206 Merge "fix(mbedtls): fix error return code for calc_hash" into integration 2024-11-08 19:37:17 +01:00
Govindraj Raja
512173980f Merge "feat(cm): test integrity of el1_ctx registers" into integration 2024-11-08 18:41:13 +01:00
Ryan Everett
885bd91f27 fix(mbedtls): fix error return code for calc_hash
Make this function return values from crypto_ret_value.
The previous method of returning the mbedtls error code
on failure meant that the authentication module couldn't
correctly parse failures from this function.

Change-Id: I9fe6eba1fc79e8f81004f8cd202781aea907e963
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-11-08 15:51:39 +00:00
Govindraj Raja
5b9e703537 Merge "fix(build): correct feature assignment for ARM v8.8 compliance" into integration 2024-11-08 16:37:56 +01:00
Govindraj Raja
a5e7d5b158 Merge "fix(arm): load dt before updating entry point" into integration 2024-11-08 16:26:05 +01:00
Yann Gautier
7ea8852ea5 Merge changes If56ed0ab,I632236a1 into integration
* changes:
  perf(build): don't check the compiler's flags for every target
  perf(build): be clever about uppercasing
2024-11-08 15:23:02 +01:00
Boyan Karatotev
316f5c97f2 perf(build): don't check the compiler's flags for every target
The TF_FLAGS variable must be recursively expanded as the rules that use
it are defined before it has been fully defined. That has the
unfortunate side effect of spawning a subshell that calls the compiler
for every file that is being built, thrashing multicore build times.

We don't cater to the possibility of the toolchain changing mid build so
precomputing this value would be more sensible. Doing a clean build on
an Intel dual socket Xeon Gold 5218 (i.e. 64 threads) workstation used
to take about 9 seconds. After this patch it takes about 1.5. Single
core performance went from ~45 seconds to about 25.

Change-Id: If56ed0ab3cc42bc482d9dd05a41ffbff4dd7f147
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2024-11-08 12:27:46 +00:00
Boyan Karatotev
f7a41fb493 perf(build): be clever about uppercasing
Most of the macros in build_macros.mk get lazily evaluated. That's
mostly fine, except for the fact that the `uppercase` macro needs to
spawn a subshell to get its output. And the target for every file
requires calling `uppercase` many, MANY, times, thrashing performance on
even the most trivial of make commands.

We can be a little clever and only call `uppercase` a handful of times
and then pass around the already uppercased strings.

The same is true about the verbosity augmentation variables. Simply
changing them to simply expanded variables allows for them to be
pre-processed and then used over and over again.

`make realclean` is a pretty good benchmark for this as it doesn't do
much else but must process all the rules, like every other make command.
On a clean checkout of TF-A on an Intel Xeon Gold 5218 (i.e.  slow
single-core) workstation, that command used to take about 7 seconds.
With this patch it takes about 0.5.

Change-Id: I632236a12a40f169e834974ecbc73ff80aac3462
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2024-11-08 12:27:46 +00:00
Jayanth Dodderi Chidanand
7623e085cb feat(cm): test integrity of el1_ctx registers
* This patch adds support to tsp (BL32) Image, to exercise
  EL1_context registers at S-EL1.

* Adds a SMC function ID "MODIFY_EL1_CTX" to handle EL1_CTX
  registers at S-EL1 and overwrite them.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: Id4f2b3b748f7bc9e6c9d72a2f03d50aefbfb61cb
2024-11-08 11:05:13 +00:00
Manish V Badarkhe
94ff1d98c9 fix(build): correct feature assignment for ARM v8.8 compliance
Correct feature list assignment to apply ARM v8.7 features
to `armv8-8-a-feats` instead of `armv8-7-a-feats` for ARM v8.8
compliance.
This was highlighted during the build of TC4 with ARM_ARCH_MAJOR=8
and ARM_ARCH_MINOR=8.

Change-Id: I6c48a3ffa2f1e18d5e4a6484a823c9112dddd751
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-11-08 09:59:54 +00:00
Yann Gautier
b40bc36c20 Merge "build(bl31): support separated memory for RW DATA" into integration 2024-11-07 18:10:51 +01:00
Govindraj Raja
212993ae7c Merge "feat(cpufeat): add ENABLE_FEAT_LS64_ACCDATA" into integration 2024-11-06 21:56:22 +01:00
Govindraj Raja
8fccbeb34a Merge "fix(psa): fix P-384 PSA key signature verification" into integration 2024-11-06 21:30:42 +01:00
Ryan Everett
12a8e95303 fix(psa): fix P-384 PSA key signature verification
The buffer size allocated for the raw ECDSA signatures
was too small for P-384 signatures. This led to mbedtls
aborting the generation of the raw sig.

Fix this by increasing the buffer size to the required
value.

Change-Id: I06a9cfe1f4cb2603c5fbe945714e90460c24edb8
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-11-06 16:58:40 +00:00
Yann Gautier
ffbc2b90df Merge "fix(romlib): prevent race condition on the build directory" into integration 2024-11-06 17:46:42 +01:00
Manish V Badarkhe
9bc738d209 Merge changes I0448caa4,I8ee666ee into integration
* changes:
  build: install dependencies before doc build
  fix(docs): fix the example command for doc build
2024-11-06 17:01:51 +01:00
Andre Przywara
19d52a83b7 feat(cpufeat): add ENABLE_FEAT_LS64_ACCDATA
Armv8.6 introduced the FEAT_LS64 extension, which provides a 64 *byte*
store instruction. A related instruction is ST64BV0, which will replace
the lowest 32 bits of the data with a value taken from the ACCDATA_EL1
system register (so that EL0 cannot alter them).
Using that ST64BV0 instruction and accessing the ACCDATA_EL1 system
register is guarded by two SCR_EL3 bits, which we should set to avoid a
trap into EL3, when lower ELs use one of those.

Add the required bits and pieces to make this feature usable:
- Add the ENABLE_FEAT_LS64_ACCDATA build option (defaulting to 0).
- Add the CPUID and SCR_EL3 bit definitions associated with FEAT_LS64.
- Add a feature check to check for the existing four variants of the
  LS64 feature and detect future extensions.
- Add code to save and restore the ACCDATA_EL1 register on
  secure/non-secure context switches.
- Enable the feature with runtime detection for FVP and Arm FPGA.

Please note that the *basic* FEAT_LS64 feature does not feature any trap
bits, it's only the addition of the ACCDATA_EL1 system register that
adds these traps and the SCR_EL3 bits.

Change-Id: Ie3e2ca2d9c4fbbd45c0cc6089accbb825579138a
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-11-06 16:52:12 +01:00
Tamas Ban
50d9383bec build: install dependencies before doc build
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I0448caa4e22c13d4dd821261642833d49ff7a234
2024-11-06 15:18:06 +01:00
Tamas Ban
9db2b059eb fix(docs): fix the example command for doc build
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I8ee666ee4cd135d09380ce31751ddba9962ff831
2024-11-06 15:18:06 +01:00
Harrison Mutai
c1c406a4de fix(arm): load dt before updating entry point
For firmware handoff, ensure the device tree (dt) is loaded into memory
before setting the entry point arguments for the next bootloader stage.
This allows the dt to be found and its address passed as an argument.

Change-Id: Ifedd7c573e2d4f6d68c596907d9d6c6a3eded317
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2024-11-06 14:13:38 +00:00
Soby Mathew
88ed66bd45 Merge "docs: el3 token signing" into integration 2024-11-06 14:38:41 +01:00
Raghu Krishnamurthy
b226357bdb docs: el3 token signing
Add documentation for the feature where EL3 can be used to sign realm
attestation token requests using RMM_EL3_TOKEN_SIGN command.
This patch also adds documentation for the RMM_EL3_FEATURES features
command that can be used to discover support for features such as
RMM_EL3_TOKEN_SIGN.

Change-Id: Iab5a157761ed17931210c3702f813198fc9c4b3a
Signed-off-by: Raghu Krishnamurthy <raghupathyk@nvidia.com>
2024-11-06 14:38:28 +01:00
Joanna Farley
a9fdd198fd Merge changes from topic "xlnx_fix_plat_extn_decl_link" into integration
* changes:
  fix(versal2): variable conflicting with external linkage
  fix(versal-net): variable conflicting with external linkage
  fix(versal): variable conflicting with external linkage
  fix(zynqmp): variable conflicting with external linkage
  fix(versal2): add external declaration
  fix(versal): add external declaration
  fix(zynqmp): add external declaration
2024-11-06 13:16:46 +01:00
Govindraj Raja
830ed3927a Merge "feat(feat_sctlr2): enable FEAT_SCTLR2 for Realm world" into integration 2024-11-05 18:29:38 +01:00
Govindraj Raja
e053e89ff8 Merge "fix(st): set no-pie option when building ST elf file" into integration 2024-11-05 16:31:24 +01:00
Govindraj Raja
add536ed8c Merge "fix(st-ddr): move skipddc_dat definition" into integration 2024-11-05 16:30:48 +01:00
Govindraj Raja
34088d7d80 Merge changes I26cefbb5,I6a8b3528,I323fb741 into integration
* changes:
  fix(stm32mp2): set PLAT_MAX_PWR_LVL to one
  feat(stm32mp2): boot BL33 at EL1 or EL2
  feat(stm32mp2): disable unsupported features
2024-11-05 16:28:25 +01:00
Yann Gautier
6b7189dd59 Merge "feat(mediatek): move plat_helpers.h to the common folder" into integration 2024-11-05 10:55:20 +01:00
Ye Li
86acbbe2d8 build(bl31): support separated memory for RW DATA
Update linker file and init codes to allow using separated
memory region for RW DATA. Init codes will copy the RW DATA
from the image to the linked address.

On some NXP platforms, after the BL31 image has been verified,
the bl31 image space will be locked/protected as RO only, so
need to move the RW DATA and NOBITS out of the bl31 image.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Change-Id: I361d9a715890961bf30790a3325f8085a40c0c39
2024-11-05 17:24:41 +08:00
Maheedhar Bollapalli
ca39fd46c1 fix(versal2): variable conflicting with external linkage
This corrects the MISRA violation C2012-5.8:
Identifiers that define objects or functions with
external linkage shall be unique.
Modify the variable name to prevent conflict with
external object linkage.

Change-Id: I2448e4ad0660e654ceb40940e0046d2f2899b41b
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2024-11-05 08:25:40 +00:00
Maheedhar Bollapalli
4d2b4e4dd7 fix(versal-net): variable conflicting with external linkage
This corrects the MISRA violation C2012-5.8:
Identifiers that define objects or functions with
external linkage shall be unique.
Modify the variable name to prevent conflict with
external object linkage.

Change-Id: Icba1860d789d3826a58b3d83b65ca86a7b364c46
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2024-11-05 08:25:29 +00:00
Maheedhar Bollapalli
e452826ad3 fix(versal): variable conflicting with external linkage
This corrects the MISRA violation C2012-5.8:
Identifiers that define objects or functions with
external linkage shall be unique.
Modify the variable name to prevent conflict with
external object linkage.

Change-Id: I118fc302e6c37ba589a2871a7c59a694314910c2
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2024-11-05 08:16:35 +00:00
Maheedhar Bollapalli
eda23fa5aa fix(zynqmp): variable conflicting with external linkage
This corrects the MISRA violation C2012-5.8:
Identifiers that define objects or functions with
external linkage shall be unique.
Modify the variable name to prevent conflict with
external object linkage.

Change-Id: I32bed542c4810508174029ab0aaec18bcdf849a5
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2024-11-05 08:16:00 +00:00
Maheedhar Bollapalli
17a8f41e45 fix(versal2): add external declaration
This corrects the MISRA violation C2012-8.4:
A compatible declaration shall be visible when an object or
function with external linkage is defined.

Change-Id: I75c8e6a23ec192417f0e09c226f53c922a43f33c
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2024-11-05 08:10:24 +00:00
Maheedhar Bollapalli
16c611f8a6 fix(versal): add external declaration
This corrects the MISRA violation C2012-8.4:
A compatible declaration shall be visible when an object or
function with external linkage is defined.

Change-Id: I91817596c5de84b259a5dffcc01a7b1106a5b7a4
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2024-11-05 08:10:17 +00:00
Maheedhar Bollapalli
6c08d1df0c fix(zynqmp): add external declaration
This corrects the MISRA violation C2012-8.4:
A compatible declaration shall be visible when an object or
function with external linkage is defined.

Change-Id: I0e554972c24b70abd5b563639482f267cd4e1b5e
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2024-11-05 08:10:10 +00:00
Gavin Liu
b741293f34 feat(mediatek): move plat_helpers.h to the common folder
The plat_helpers.h is identical across various platforms, moved to the
common folder for easier maintenance.

Change-Id: Ic9f10c697fcda7e3cfbf32e67486c9cd28481b8a
Signed-off-by: Gavin Liu <gavin.liu@mediatek.com>
2024-11-05 15:46:19 +08:00
Javier Almansa Sobrino
b17fecd6cf feat(feat_sctlr2): enable FEAT_SCTLR2 for Realm world
Change-Id: I62e769ae796bbeb41741c2c421a5f129d875f5fb
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
2024-11-05 06:07:36 +02:00
Manish V Badarkhe
0a4cecadd7 Merge changes from topic "dtpm_poc" into integration
* changes:
  feat(docs): add DPE to RSE desing doc
  feat(docs): add RSE provided mboot backends to the threat model
  feat(docs): update mboot threat model
2024-11-04 22:16:46 +01:00
Yann Gautier
13cc1a5064 fix(st-ddr): move skipddc_dat definition
The skipddc_dat variable is only use at one place in dfixlat_program()
function. Move its definition and update there to avoid compilation
issues about variables being set but not used.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I6b5273365f1da26773fc46f898362cb9af170506
2024-11-04 18:45:26 +01:00
Tamas Ban
e4582e4247 feat(docs): add DPE to RSE desing doc
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Iec38be8a3eb93a54d9b5bc7db7a7ff8c126920ac
2024-11-04 17:28:15 +01:00
Tamas Ban
3849d272e3 feat(docs): add RSE provided mboot backends to the threat model
Add CCA Measured Boot and DPE measured boot backends to
the threat model.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: I234a2400d00fea606c5312ebddf94e2624463ff8
2024-11-04 17:25:15 +01:00
Abhi Singh
07c2d18f4e feat(docs): update mboot threat model
Restructure Measured Boot threat model for more description and clarity:
- Add what critical assets are to be protected.
- Mention other attributes and the possible attacks.
- Rephrase the section that describes the Measured Boot backends.

Change-Id: I6577a56184992bf16f4aa1b773d1636781cbb049
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
2024-11-04 17:21:08 +01:00
Manish V Badarkhe
e01bcfb02c Merge "build: fix grouped targets on Make <= 4.2" into integration 2024-11-04 15:22:35 +01:00
Manish Pandey
0bc3e4a16c Merge "chore(tc): mark TC2 platform as deprecated in Makefile" into integration 2024-11-04 13:38:37 +01:00
Manish Pandey
6ecae4d26f Merge "feat(mt8188): add MT8188 TRNG driver" into integration 2024-11-04 12:17:55 +01:00