Commit graph

16611 commits

Author SHA1 Message Date
Bipin Ravi
4a871b56b4 Merge changes from topic "ar/cvereorder" into integration
* changes:
  chore(cpus): rearrange the errata and cve order in Neoverse-N2
  chore(cpus): rearrange cve in order in Cortex-X1
  chore(cpus): fix cve order in Neoverse-V1
  chore(cpus): fix cve order in Cortex-X2
  chore(cpus): fix cve order in Cortex-A78C
  chore(cpus): fix cve order in Cortex-A78_AE
  chore(cpus): fix cve order in Cortex-A78
  chore(cpus): fix cve order in Cortex-A77
2025-03-21 17:08:04 +01:00
Bipin Ravi
43b56d9111 Merge "refactor(cpus): don't panic if errata out of order" into integration 2025-03-21 17:07:06 +01:00
Sona Mathew
ede127e66c chore(cpus): rearrange the errata and cve in order in Cortex-X4
Patch sorts the errata IDs in ascending order and the
CVE's in ascending order based on the year and index
for CPU Cortex-X4.

Change-Id: Ic304c2f68e7d0b96bbb30760696b7bceabe1ae2d
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2025-03-21 10:50:14 -05:00
Sona Mathew
6b922fe0f3 chore(cpus): rearrange cve and errata order in Cortex-X3
Patch sorts the errata IDs in ascending order and the
CVE-2024-5660 in order based on the year and index
for Cortex-X3.

Change-Id: I2a4baebe0c3133528c089d999bdffa8c992f4989
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2025-03-21 10:50:14 -05:00
Sona Mathew
174ed6188a chore(cpus): fix cve order in Neoverse-V2
Patch rearranges CVE-2024-5660 in order based on
the year and index for Neoverse-V2.

Change-Id: I092a93ef3299fd733abae9c462c019f94d881413
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2025-03-21 10:50:14 -05:00
Sona Mathew
216d437c0d chore(cpus): rearrange the errata and cve order in Neoverse-N2
Patch sorts the errata IDs in ascending order and the
CVE's in ascending order based on the year and index
for CPU Neoverse N2.

Change-Id: Ieb4a8ab0030ea4e83efdef86a0ff1e2990b3e0dd
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2025-03-21 10:50:14 -05:00
Sona Mathew
4cf62406ed chore(cpus): rearrange the errata and cve in order in Neoverse-V3
Patch sorts the errata IDs in ascending order and the CVE's
in ascending order based on the year and index for Neoverse-V3.

Change-Id: I108eb2896e24c135d56e5096289766d777b48b48
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2025-03-21 10:50:14 -05:00
Sona Mathew
10a8e85cba chore(cpus): rearrange the errata and cve in order in Cortex-A710
Patch sorts the errata IDs in ascending order and the
CVE's in ascending order based on the year and index
for CPU Cortex-A710.

Change-Id: Ie7c2b77879f8fa5abb77204678e09cc759b10278
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2025-03-21 10:50:14 -05:00
Sona Mathew
e83cccfec4 chore(cpus): rearrange cve in order in Cortex-X1
Patch rearranges CVE-2024-5660 in ascending order based on
the year and index for Cortex X1.

Change-Id: I0c4206e38f09b1f88ee95e8ce69d7e13b8a9bb2d
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2025-03-21 10:50:14 -05:00
Arvind Ram Prakash
5c43b966fd chore(cpus): fix cve order in Neoverse-V1
This patch rearranges CVE-2024-5660 apply order in Neoverse-V1.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Ice0b1c6efa913f88522fb33182b9cdc0e7723988
2025-03-21 10:50:14 -05:00
Arvind Ram Prakash
eb9220b2d1 chore(cpus): fix cve order in Cortex-X2
This patch rearranges CVE-2024-5660, erratum 2313941
and 3701772 apply order in Cortex-X2.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Ie74d7232a14f3cdd14c4d0ffb1ee91b537c491ea
2025-03-21 10:50:14 -05:00
Arvind Ram Prakash
97b1023b46 chore(cpus): fix cve order in Cortex-A78C
This patch rearranges CVE-2024-5660 apply order in Cortex-A78C.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I326be1da279bd34df8667f7e957fb4a2c6913ab9
2025-03-21 10:50:14 -05:00
Arvind Ram Prakash
85526d4b84 chore(cpus): fix cve order in Cortex-A78_AE
This patch rearranges CVE-2024-5660 apply order in Cortex-A78_AE.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Idfb076b798a840847c00066bd062ee919369272f
2025-03-21 10:50:14 -05:00
Arvind Ram Prakash
67a4f6f96d chore(cpus): fix cve order in Cortex-A78
This patch rearranges CVE-2024-5660 apply order in Cortex-A78.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: If80a0f95f82dbf69100a2687b06db2373a9e9832
2025-03-21 10:50:14 -05:00
Arvind Ram Prakash
06f2cfb8ac chore(cpus): fix cve order in Cortex-A77
This patch rearranges CVE-2024-5660 apply order in Cortex-A77.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I41d76268ce2248bfd3600bbf6b89d16b6bdce8f0
2025-03-21 10:50:14 -05:00
Arvind Ram Prakash
3426ed4966 refactor(cpus): don't panic if errata out of order
Previously we have used enclosed the Errata ordering check
within the FEATURE_DETECTION flag as this flag is only
used for development purpose and it also enforces
ordering by causing a panic when the assert fails.
A simple warning message would suffice and hence this
patch removes the assert.

The erratum and cve ordering check is planned to be implemented
in static check at which point the warning will be taken out as well.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I0ffc40361985281163970ea5bc81ca0269b16442
2025-03-21 10:49:31 -05:00
Manish V Badarkhe
9526c2f9ef Merge "fix(plat): remove unused vfp code" into integration 2025-03-21 14:41:37 +01:00
Manish V Badarkhe
2f4bcc08bb Merge "feat(zynqmp): add pin group for lower qspi interface" into integration 2025-03-21 12:30:41 +01:00
Manish V Badarkhe
d3ebd2a111 Merge "chore(docs): explain what the plat_amu_aux_enables array does" into integration 2025-03-21 12:26:06 +01:00
Manish V Badarkhe
4c7fa977b7 Merge "chore(cm): add MDCR_EL3.RLTE to context management" into integration 2025-03-21 12:25:42 +01:00
Manish V Badarkhe
3c198a97ad Merge "fix(rdv3): correctly handle FP regs context saving" into integration 2025-03-21 10:13:57 +01:00
Runyang Chen
2be3014f6b refactor(mediatek): fix mcusys off issue for MTK GIC v3 driver
When mcusys is off, rdist_ctx will save the rdist data of the last core.
In the case of the last core plug off, the data of other cores will be
inconsistent with the data in rdist_ctx.

Therefore, each core needs to use a dedicated context.

Signed-off-by: Runyang Chen <runyang.chen@mediatek.com>
Change-Id: Ic9501f4da219cf906c0e348982be3f550c3ba30b
2025-03-21 06:38:05 +01:00
Madhukar Pappireddy
38b5f93a2b Merge "feat(lib): implement strnlen secure and strcpy secure function" into integration 2025-03-20 15:44:44 +01:00
Boyan Karatotev
a507f4f5f0 feat(fvp): give bootargs on all configs
Linux needs bootargs with or without RME. Have them always on.

Change-Id: I4e7f582862ba9a0a96c0d6de10d021eed51740d6
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-03-20 14:06:48 +00:00
Harrison Mutai
8921349894 refactor(arm): simplify early platform setup functions
Refactor `arm_sp_min_early_platform_setup` to accept generic
`u_register_r` values to support receiving firmware handoff boot
arguments in common code. This has the added benefit of simplifying the
interface into common early platform setup.

Change-Id: Idfc3d41f94f2bf3a3a0c7ca39f6b9b0013836e3a
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2025-03-20 13:57:14 +00:00
Rakshit Goyal
ac05182df0 fix(rdv3): correctly handle FP regs context saving
Commit fe488c3796 added an override to
force `CTX_INCLUDE_SVE_REGS` to 0 when `SPD == spmd` and
`SPMD_SPM_AT_SEL2 == 1`.
Since there is an architectural dependency between FP and SVE registers,
`CTX_INCLUDE_FPREGS` must also be overridden to 0 when
CTX_INCLUDE_SVE_REGS is 0.

Signed-off-by: Rakshit Goyal <rakshit.goyal@arm.com>
Change-Id: I1cd834241a2d5a5368ac532a348d8729a701bbcd
2025-03-20 13:04:53 +00:00
Manish V Badarkhe
b19345ea3a Merge "build(poetry): install SP dependencies with --no-root" into integration 2025-03-20 13:26:12 +01:00
Manish V Badarkhe
7e84854015 Merge changes from topic "dtpm_poc" into integration
* changes:
  feat(docs): update mboot threat model with dTPM
  docs(tpm): add design documentation for dTPM
  fix(rpi3):  expose BL1_RW to BL2 map for mboot
  feat(rpi3): add dTPM backed measured boot
  feat(tpm): add Infineon SLB9670 GPIO SPI config
  feat(tpm): add tpm drivers and framework
  feat(io): add generic gpio spi bit-bang driver
  feat(rpi3): implement eventlog handoff to BL33
  feat(rpi3): implement mboot for rpi3
2025-03-20 12:57:14 +01:00
Soby Mathew
4848824548 Merge changes from topic "mec" into integration
* changes:
  feat(qemu): add plat_rmmd_mecid_key_update()
  feat(rmmd): add RMM_MECID_KEY_UPDATE call
2025-03-20 10:26:23 +01:00
Boyan Karatotev
c1b0a97b7a chore(cm): add MDCR_EL3.RLTE to context management
The bit is already implicitly zero so no functional change. Adding it
helps fully describe how we expect FEAT_TRF to behave.

Change-Id: If7a7881e2b50188222ce46265b432d658a664c75
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-03-20 07:26:15 +00:00
Boyan Karatotev
a02495ea5b chore(docs): explain what the plat_amu_aux_enables array does
Change-Id: I90f1bcaa8bec133d3be81785aea11948208ca0a5
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-03-19 16:54:50 +01:00
Boyan Karatotev
18b129f4c1 fix(plat): remove unused vfp code
The code is never referenced, the build flag is never defined and some
of the #defines are missing. Remove.

Change-Id: I44caae52f9b7503363ac553fd1187bbf6c951438
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-03-19 16:54:11 +01:00
Chris Kay
679e27ce58 build(poetry): install SP dependencies with --no-root
Change-Id: I2981cb438be6f4569d069203b555310588db2627
Signed-off-by: Chris Kay <chris.kay@arm.com>
2025-03-19 15:06:16 +00:00
Joanna Farley
c03884e51f Merge "fix(versal2): rename console build arg to generic" into integration 2025-03-19 10:48:49 +01:00
Jit Loon Lim
eb088894dc feat(lib): implement strnlen secure and strcpy secure function
Implement safer version of 'strnlen' function
to handle NULL terminated strings with additional
bound checking and secure version of string copy function
to support better security and avoid destination
buffer overflow.

Change-Id: I93916f003b192c1c6da6a4f78a627c8885db11d9
Signed-off-by: Jit Loon Lim <jit.loon.lim@altera.com>
Signed-off-by: Girisha Dengi <girisha.dengi@intel.com>
2025-03-19 12:57:35 +08:00
Jean-Philippe Brucker
9c9a31eb9a feat(qemu): add plat_rmmd_mecid_key_update()
Add an implementation of the plat_rmmd_mecid_key_update() callback, that
updates the MEC keys associated with a MECID. Leave it empty for now,
since QEMU doesn't yet implement an MPE (Memory Protection Engine).

Change-Id: I2746f6024f28e4fd487726de9e43e14d8cad57a0
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
2025-03-18 19:43:16 -05:00
Tushar Khandelwal
f801fdc22e feat(rmmd): add RMM_MECID_KEY_UPDATE call
With this addition, TF-A now has an SMC call to handle the
update of MEC keys associated to MECIDs.

The behavior of this newly added call is empty for now until an
implementation for the MPE (Memory Protection Engine) driver is
available. Only parameter sanitization has been implemented.

Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Change-Id: I2a969310b47e8c6da1817a79be0cd56158c6efc3
2025-03-18 17:17:06 -05:00
Abhi Singh
b00f6ece56 feat(docs): update mboot threat model with dTPM
Add the discrete TPM to the TCG event log section of the measured boot
threat model. Include the example of a physical vurnerability that can
be used to compromise a dTPM.

Signed-off-by: Abhi Singh <abhi.singh@arm.com>
Change-Id: I2c06edf5e9031adc970c24426a8ae52b06efb614
2025-03-18 20:54:29 +01:00
Abhi Singh
a2dd13cacb docs(tpm): add design documentation for dTPM
-documentation for Discrete TPM drivers.
-documentation for a proof of concept on rpi3;
 Measured Boot using Discrete TPM.

Signed-off-by: Abhi Singh <abhi.singh@arm.com>
Change-Id: If8e7c14a1c0b9776af872104aceeff21a13bd821
2025-03-18 20:53:44 +01:00
Abhi Singh
9acaaded3c fix(rpi3): expose BL1_RW to BL2 map for mboot
BL2 requires the ability to access the TCG Event Log during
Measured Boot. Currently the Platform hangs since the Event Log
is not exposed to BL2's mmap. Define a RPI3_BL1_RW region to be
added to the BL2 Image, if Measured Boot is enabled.

Change-Id: Ic236a80e73ea342b4590cfb65bafbb8ffac17085
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
2025-03-18 20:53:27 +01:00
Abhi Singh
4f9894db35 feat(rpi3): add dTPM backed measured boot
In BL1 and BL2 add support for the use of an Infineon Optiga SLB 9670
TPM2.0.
The platform utilizes the gpio_spi.c driver to bit-bang gpio pins in
order to send commands and receive responses to/from the TPM.
In BL1 & BL2:
-utilize TPM commands to initialize the gpio pins for "spi"
 communication, and extend image hashes to the TPM's PCR 0,
 at the end of the measured boot phase for the bootloader,
 the TPM locality is released.
-Bl1 executes a tpm_startup command in order to flush the TPM.

Change-Id: I2f2fa28f60a262a0aa25a674c72a9904b3cf4d8a
Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
2025-03-18 19:59:03 +01:00
Abhi Singh
6fa56e9367 feat(tpm): add Infineon SLB9670 GPIO SPI config
add the Infineon Optiga SLB9670 TPM2.0 GPIO SPI
configuration data, as well as chip reset and the
GPIO SPI bitbang driver initialization. This code
supports use with the rpi3 platform, with availibility
to add configuration parameters for other platforms

Change-Id: Ibdffb28fa0b3b5a18dff2ba5d4ea305633740763
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
2025-03-18 19:57:56 +01:00
Abhi.Singh
36e3d877cd feat(tpm): add tpm drivers and framework
Add tpm2 drivers to tf-a with adequate framework
-implement a fifo spi interface that works
 with discrete tpm chip.
-implement tpm command layer interfaces that are used
 to initialize, start and make measurements and
 close the interface.
-tpm drivers are built using their own make file
 to allow for ease in porting across platforms,
 and across different interfaces.

Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
Change-Id: Ie1a189f45c80f26f4dea16c3bd71b1503709e0ea
2025-03-18 19:57:22 +01:00
Abhi Singh
3c54570afc feat(io): add generic gpio spi bit-bang driver
When using a tpm breakout board with rpi3, we elected to bit-bang
gpio pins to emulate a spi interface, this implementation required a
driver to interface with the platform specific pins and emulate spi
functionality. The generic driver provides the ability to pass in a
gpio_spi_data structure that contains the necessary gpio pins in
order to simulate spi operations (get_access, start, stop, xfer).

Change-Id: I88919e8a294c05e0cabb8224e35ae5c1ba5f2413
Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
2025-03-18 19:56:16 +01:00
Abhi Singh
6dfcf4e1df feat(rpi3): implement eventlog handoff to BL33
At the end of BL2 measured boot, write the address
and size of the TCG Event Log to NT_FW_CONFIG so
that the log can be consumed later by BL33.
-add dynamic configuration helpers for the fdt
-write the eventlog address and size to the fdt

Change-Id: I099dd9cc96d740ae13cb8b8e8c6b9f2e6c02accc
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
2025-03-18 19:54:35 +01:00
Abhi Singh
c4c9e2bc43 feat(rpi3): implement mboot for rpi3
Add Measured Boot support using the Event Log backend for the rpi3
platform.
-Implement measured boot infrastructure in BL1 & BL2, including
 the init, measure image, and finish phases.
-Pass the eventlog addr and size from BL1 to BL2 using the
 image entry point args.
-dump the eventlog after measuring BL2, and after all images are
 measured in BL2.

Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
Signed-off-by: Abhi Singh <abhi.singh@arm.com>
Change-Id: I7c040c4a2d001a933fefb0b16f0fdf2a43a11be9
2025-03-18 19:52:57 +01:00
Maheedhar Bollapalli
2333ab4cd2 fix(versal2): rename console build arg to generic
Rename VERSAL2_CONSOLE build argument to CONSOLE to
keep it aligned with generic build arguments.

Change-Id: I0f4967aa262f0300d8f76f6638030a1839901234
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-18 16:52:16 +00:00
Bipin Ravi
fa8ca8bcd0 Merge "fix(errata): workaround for Cortex-A510 erratum 2971420" into integration 2025-03-17 22:32:57 +01:00
Govindraj Raja
4e2a88a554 Merge "fix(cpufeat): add feat_hcx check before enabling FEAT_MOPS" into integration 2025-03-17 19:50:52 +01:00
John Powell
f2bd352820 fix(errata): workaround for Cortex-A510 erratum 2971420
Cortex-A510 erratum 2971420 applies to revisions r0p1, r0p2, r0p3,
r1p0, r1p1, r1p2 and r1p3, and is still open.

Under some conditions, data might be corrupted if Trace Buffer
Extension (TRBE) is enabled. The workaround is to disable trace
collection via TRBE by programming MDCR_EL3.NSTB[1] to the opposite
value of SCR_EL3.NS on a security state switch. Since we only enable
TRBE for non-secure world, the workaround is to disable TRBE by
setting the NSTB field to 00 so accesses are trapped to EL3 and
secure state owns the buffer.

SDEN: https://developer.arm.com/documentation/SDEN-1873361/latest/

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: Ia77051f6b64c726a8c50596c78f220d323ab7d97
2025-03-17 19:04:54 +01:00