Commit graph

2496 commits

Author SHA1 Message Date
Sona Mathew
30019d8698 feat(cpufeat): add feature detection for FEAT_CSV2_3
This feature provides support to context save the
SCXTNUM_ELx register. FEAT_CSV2_3 implies the implementation
of FEAT_CSV2_2. FEAT_CSV2_3 is supported in AArch64 state only
and is an optional feature in Arm v8.0 implementations.

This patch adds feature detection for v8.9 feature FEAT_CSV2_3,
adds macros for ID_AA64PFR0_EL1.CSV2 bits [59:56] for detecting
FEAT_CSV2_3 and macro for ENABLE_FEAT_CSV2_3.

Change-Id: Ida9f31e832b5f11bd89eebd6cc9f10ddad755c14
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2024-01-29 14:06:56 +00:00
Sandrine Bailleux
6c2c8528ac docs: import MISRA compliance spreadsheet
TF-A aims to comply with MISRA C:2012 Guidelines. We maintain a list of
all rules and directives and whether the project aims to comply with
them or not. A rationale is given for each deviation.

This list used to be provided as an '.ods' spreadsheet file hosted on
developer.trustedfirmware.org. This raises the following issues:

 - The list is not version-controlled under the same scheme as TF-A
   source code. This could lead to synchronization issues between the
   two.

 - The file needs to be open in a separate program, which is not as
   straightforward as reading it from TF-A documentation itself.

 - developer.trustedfirmware.org is deprecated, thus the file cannot be
   safely kept there for any longer.

To address these issues, convert the '.ods' file into a CSV (Comma
Separated Values) file, which we import into TF-A source tree itself.
Make use of Sphinx's ability to process and render CSV files as tables
to display that information directly into the Coding Guidelines
document.

Also make the following minor changes along the way:

 - Remove dead link to MISRA C:2012 Guidelines page. Replace it with a
   link to a Wikipedia page to give a bit of context to the reader.

 - We no longer use Coverity for MISRA compliance checks. Instead, we
   use ECLAIR nowadays. Reflect this in the document.

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I422fdd8246f4f9c2498c1be18115408a873b86ac
2024-01-29 11:43:51 +01:00
Sandrine Bailleux
77f7a6a8ca docs: update links to TF-A issues tracker
developer.trustedfirmware.org is deprecated so we cannot use its issues
tracker anymore. Instead, the project will now make use of the issues
tracker associated with the project's Github mirror at [1].

Reflect this change in TF-A documentation.

[1] https://github.com/TrustedFirmware-A/trusted-firmware-a/issues

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I912f7dafc74368dba4e61ba4c9f358d5bf8346a9
2024-01-26 14:11:04 +01:00
Bipin Ravi
c1aa3fa555 fix(cpus): workaround for Cortex X3 erratum 2641945
Cortex X3 erratum 2641945 is a Cat B erratum that applies to all
revisions <= r1p0 and is fixed in r1p1.

The workaround is to disable the affected L1 data cache prefetcher
by setting CPUACTLR6_EL1[41] to 1. Doing so will incur a performance
penalty of ~1%. Contact Arm for an alternate workaround that impacts
power.

SDEN documentation:
https://developer.arm.com/documentation/2055130/latest

Change-Id: Ia6d6ac8a66936c63b8aa8d7698b937f42ba8f044
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
2024-01-25 17:14:54 -06:00
Rohit Mathew
341df6af6e feat(arm): move GPT setup to common BL source
As of now, GPT setup is being handled from BL2 for plat/arm platforms.
However, for platforms having a separate entity to load firmware images,
it is possible for BL31 to setup the GPT. In order to address this
concern, move the GPT setup implementation from arm_bl2_setup.c file to
arm_common.c. Additionally, rename the API from arm_bl2_gpt_setup to
arm_gpt_setup to make it boot stage agnostic.

Signed-off-by: Rohit Mathew <Rohit.Mathew@arm.com>
Change-Id: I35d17a179c8746945c69db37fd23d763a7774ddc
2024-01-25 10:45:22 +00:00
Rohit Mathew
86e4859a05 feat(arm): retrieve GPT related data from platform
For RME-enabled platforms, initializing L0 and L1 tables and enabling
GPC checks is necessary. For systems using BL2 to load firmware images,
the GPT initialization has to be done in BL2 prior to the image load.
The common Arm platform code currently implements this in the
"arm_bl2_plat_gpt_setup" function, relying on the FVP platform's
specifications (PAS definitions, GPCCR_PPS, and GPCCR_PGS).

Different Arm platforms may have distinct PAS definitions, GPCCR_PPS,
GPCCR_PGS, L0/L1 base, and size. To accommodate these variations,
introduce the "plat_arm_get_gpt_info" API. Platforms must implement
this API to provide the necessary data for GPT setup on RME-enabled
platforms. It is essential to note that these additions are relevant to
platforms under the plat/arm hierarchy that will reuse the
"arm_bl2_plat_gpt_setup" function.

As a result of these new additions, migrate data related to the FVP
platform to its source and header files.

Signed-off-by: Rohit Mathew <Rohit.Mathew@arm.com>
Change-Id: I4f4c8894c1cda0adc1f83e7439eb372e923f6147
2024-01-25 10:45:22 +00:00
Andre Przywara
641571c728 docs(cpufeat): clarify description of FEATURE_DETECTION macro
The current documentation of the FEATURE_DETECTION build option seems
to suggest that this macro enables the dynamic runtime checking of
features, although this is done regardless of this debug feature.
FEATURE_DETECTION just adds the detect_arch_features() function to the
build and calls it early on, plus it enables the CPU errata order
checking.

Simplify the description of the FEATURE_DETECTION macro to make this
clear, and move the dynamic feature detection description into a
separate section, before all the specific ENABLE_FEAT_xxx explanations.

This also renames all mentioning of:
"... to align with the FEATURE_DETECTIION mechanism ..."
with:
"... to align with the ENABLE_FEAT mechanism ..."
in the description of each feature.

Change-Id: I5f4dd2d1e43bd440687b7cee551d02ec853d4e23
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-01-24 20:51:09 +00:00
Manish V Badarkhe
61dfdfd4db Merge "refactor(mte): deprecate CTX_INCLUDE_MTE_REGS" into integration 2024-01-24 11:05:32 +01:00
Lauren Wehrmeister
3f02459572 Merge changes from topic "errata" into integration
* changes:
  fix(cpus): workaround for Cortex-A78C erratum 2683027
  fix(cpus): workaround for Cortex-X3 erratum 2266875
  fix(cpus): workaround for Cortex-X3 erratum 2302506
2024-01-23 21:43:06 +01:00
Govindraj Raja
0a33adc058 refactor(mte): deprecate CTX_INCLUDE_MTE_REGS
Currently CTX_INCLUDE_MTE_REGS is used for dual purpose,
to enable allocation tags register and to context save and restore
them and also to check if mte feature is available.

To make it more meaningful, remove CTX_INCLUDE_MTE_REGS
and introduce FEAT_MTE. This would enable allocation tags register
when FEAT_MTE is enabled and also supported from platform.

Also arch features can be conditionally enabled disabled based on
arch version from `make_helpers/arch_features.mk`

Change-Id: Ibdd2d43874634ad7ddff93c7edad6044ae1631ed
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2024-01-23 11:58:55 -06:00
Joanna Farley
1064bc6c8c Merge changes from topic "idling-during-subsystem-restart" into integration
* changes:
  fix(xilinx): add console_flush() before shutdown
  fix(xilinx): fix sending sgi to linux
  feat(xilinx): add new state to identify cpu power down
  feat(xilinx): request cpu power down from reset
  feat(xilinx): power down all cores on receiving cpu pwrdwn req
  feat(xilinx): add handler for power down req sgi irq
  feat(xilinx): add wrapper to handle cpu power down req
  fix(versal-net): use arm common GIC handlers
  fix(xilinx): rename macros to align with ARM
2024-01-22 16:12:02 +01:00
Manish V Badarkhe
99f9aacd20 Merge "docs(threat-model): supply chain threat model TF-A" into integration 2024-01-22 14:45:17 +01:00
Olivier Deprez
81704f5d30 Merge "docs(security): security advisory for CVE-2023-49100" into integration 2024-01-22 10:41:55 +01:00
laurenw-arm
b908814c74 docs(threat-model): supply chain threat model TF-A
Software supply chain attacks aim to inject malicious code into a
software product. There are several ways a malicious code can be
injected into a software product (open-source project).

These include:
- Malicious code commits
- Malicious dependencies
- Malicious toolchains

This document provides analysis of software supply chain attack
threats for the TF-A project

Change-Id: I03545d65a38dc372f3868a16c725b7378640a771
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
2024-01-19 14:50:24 -06:00
Lauren Wehrmeister
57410eebe6 Merge "docs(threat-model): add threat model for PSA FWU and TBBR FWU(recovery)" into integration 2024-01-19 21:39:59 +01:00
Manish V Badarkhe
bb4d7d7195 docs(threat-model): add threat model for PSA FWU and TBBR FWU(recovery)
Added a threat model for PSA firmware update as well as TBBR FWU aka
firmware recovery.

Change-Id: I2396e13144076d7294f61f6817e1a8646225c6c2
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-01-19 10:23:36 +00:00
laurenw-arm
dc35bd320c docs(arm): update TBBR CoT dtsi file name in doc
Change-Id: I31ebee7574f5133aadbf2767377fd74a21775ce5
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
2024-01-18 13:55:07 -06:00
laurenw-arm
0de9a12c89 docs(fconf): update bindings for multi-RoT CoTs
Update CoT binding documentation to add the signing-key property
as optional in root-certificates and add rot_keys node

Change-Id: I1d1fbc0394275520cfa43213d5b7006e51990fdd
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
2024-01-18 13:53:27 -06:00
Manish Pandey
d1eb4e2377 docs(security): security advisory for CVE-2023-49100
Reported-by: Christian Lindenmeier <christian.lindenmeier@fau.de>
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I13fa93a65e5017dae6c837e88cd80bda72d4c2a3
2024-01-18 17:40:26 +00:00
Bipin Ravi
68cac6a0f2 fix(cpus): workaround for Cortex-A78C erratum 2683027
Cortex-A78C erratum 2683027 is a cat B erratum that applies to
revisions r0p1 - r0p2 and is still open. The workaround is to
execute a specific code sequence in EL3 during reset.

SDEN can be found here:
https://developer.arm.com/documentation/SDEN-2004089/latest

Change-Id: I2bf9e675f48b62b4cd203100f7df40f4846aafa8
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
2024-01-17 14:28:04 -06:00
Bipin Ravi
a65c5ba351 fix(cpus): workaround for Cortex-X3 erratum 2266875
Cortex-X3 erratum 2266875 is a Cat B erratum that applies to
all revisions <= r1p0 and is fixed in r1p1. The workaround is to
set CPUACTLR_EL1[22]=1 which will cause the CFP instruction to
invalidate all branch predictor resources regardless of context.

SDEN Documentation:
https://developer.arm.com/documentation/2055130/latest

Change-Id: I9c610777e222f57f520d223bb03fc5ad05af1077
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
2024-01-17 14:27:08 -06:00
Bipin Ravi
3f9df2c6ad fix(cpus): workaround for Cortex-X3 erratum 2302506
Cortex-X3 erratum 2302506 is a cat B erratum that applies to
revisions r0p0-r1p1 and is fixed in r1p2. The workaround is to
set bit[0] of CPUACTLR2 which will force PLDW/PFRM ST to behave
like PLD/PRFM LD and not cause invalidation to other PE caches.

There might be a small performance degradation to this workaround
for certain workloads that share data.

SDEN can be found here:
https://developer.arm.com/documentation/2055130/latest

Change-Id: I048b830867915b88afa36582c6da05734a56d22a
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
2024-01-17 14:22:21 -06:00
Michael Trimarchi
6611e81e14 fix(rockchip): fix documentation in how build bl31 in AARCH64
Rockchip Aarch64 SoCs expect TF-A's BL31

Change-Id: Ie74be32e2bd24c4de38990791b4a03d2b7695b4d
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-01-15 11:25:58 +01:00
Manish V Badarkhe
34bb883a56 docs(threat-model): provide PSR specification reference
Added an assumption in generic threat model that platform's hardware
conforms the Platform Security Requirements specification.

Change-Id: I753287feec1cd459edfd3d1c103e0e701827cc05
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2024-01-13 08:04:03 +00:00
Jay Buddhabhatti
ade92a64e4 feat(xilinx): add handler for power down req sgi irq
On receiving CPU power down callback, TF-A raises SGI interrupt to all active
cores to power down each active cores. Add handler for this SGI IRQ.

By default TF-A uses SGI 6 for CPU power down request. This can be
configurable through CPU_PWRDWN_SGI build flag.

e.g., If user wants to use SGI 7 instead of SGI 6 then provide build
flag CPU_PWRDWN_SGI=7

Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Change-Id: Id0df32187d1de3f0af4486eb4d4930cb3ab01dbd
2024-01-09 04:15:27 -08:00
Juan Pablo Conde
bfef8b908e feat(context-mgmt): report context memory usage
This patch provides a reporting functionality to display the memory
consumed by the context in each security state and for each exception
level. Flag PLATFORM_REPORT_CTX_MEM_USE enables or disables this
feature.

Change-Id: I1515366bf87561dcedf2b3206be167804df681d4
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2023-12-29 14:37:14 +00:00
Arvind Ram Prakash
9acff28ae4 build(mpam): add new build option CTX_INCLUDE_MPAM_REGS
New build option CTX_INCLUDE_MPAM_REGS is added to select
if the firmware needs to save the MPAM EL2 registers during world
switches. This option is currently disabled as MPAM is only
enabled for NS world.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Ie2e5e184cdb65f7e1a98d8fe81590253fd859679
2023-12-27 11:50:41 -06:00
Sandrine Bailleux (on vacation)
4d64be308a Merge "docs: update links to tf.org-wide process documents" into integration 2023-12-27 11:19:14 +01:00
Bipin Ravi
9ac42bf263 Merge "fix(cpus): workaround for Cortex X3 erratum 2743088" into integration 2023-12-21 18:07:00 +01:00
Sandrine Bailleux
979c5482de docs: update links to tf.org-wide process documents
tf.org-wide documents have been migrated away from
developer.trustedfirmware.org, because the latter will be
decomissioned at some point in the future. These documents are now
hosted in a new 'tf_docs' repository hosted on Github [1] and can be
easily browsed through a new ReadTheDocs website at [2].

Update all relevant links in TF-A documentation to refer to [2].

[1] https://github.com/TrustedFirmware/tf_docs
[2] https://trusted-firmware-docs.readthedocs.io/

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: Ib9d39c36250a05754fe5e46cb6f3044ecb776534
2023-12-21 13:59:49 +01:00
Harrison Mutai
f43e9f57dc fix(cpus): workaround for Cortex X3 erratum 2743088
Cortex X3 erratum 2743088 is a Cat B erratum that applies to all
revisions <= r1p1 and is fixed in r1p2. The workaround is to add a DSB
instruction before the ISB of the powerdown code sequence specified in
the TRM.

SDEN documentation: https://developer.arm.com/documentation/2055130

Change-Id: I2c8577e3ca0781af8b1c3912e577d3bd77f92709
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2023-12-20 17:34:28 +00:00
Prasad Kummari
96c031c7fe docs(versal): add ERRATA_ABI_SUPPORT build documentation
Add information about Versal platform for ERRATA_ABI_SUPPORT and
provide the build commands.

Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Change-Id: I8466ea446814f888ae56f5cbb7bbdc06099d54f8
2023-12-20 17:25:39 +05:30
Arvind Ram Prakash
34db3531ba fix(cpus): workaround for Cortex-A520 erratum 2858100
Cortex-A520 erratum 2858100 is a Cat B erratum that applies to
all revisions <=r0p1 and is still open. The workaround is to
set bit[29] of CPUACTLR_EL1.

SDEN Documentation:
https://developer.arm.com/documentation/SDEN-2444153/latest

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: I5a07163f919352583b03328abd5659bf7b268677
2023-12-18 14:04:26 -06:00
Sona Mathew
f03bfc3045 fix(cpus): workaround for Cortex-A520 erratum 2630792
Cortex-A520 erratum is a Cat B erratum that applies
to revisions r0p0 and r0p1 and is still open.
The workaround is to set CPUACTLR_EL1[38] to 1.

SDEN Documentation:
https://developer.arm.com/documentation/SDEN-2444153/latest

Change-Id: Idb6f32f680ee1378a57c2d2f809ea847fffe5910
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2023-12-12 15:45:28 -06:00
Sona Mathew
b01a93d778 fix(cpus): workaround for Cortex-X2 erratum 2778471
Cortex-X2 erratum 2778471 is a Cat B erratum that applies
to revisions r0p1, r1p0, r2p0 and r2p1 and is still open.
The workaround is to set CPUACTLR3_EL1[47] to 1.

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

Change-Id: Ia95f0e276482283bf50e06c58c2bc5faab3f62c6
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2023-12-12 15:45:28 -06:00
Sona Mathew
c9508d6a10 fix(cpus): workaround for Cortex-A710 erratum 2778471
Cortex-A710 erratum 2778471 is a Cat B erratum that applies
to revisions r0p1, r1p0, r2p0 and r2p1 and is still open.
The workaround is to set CPUACTLR3_EL1[47] to 1.

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

Change-Id: Id3bb4a2673e41ff237682e46784d37752daf2f83
Signed-off-by: Sona Mathew <sonarebecca.mathew@arm.com>
2023-12-12 15:45:25 -06:00
Javier Almansa Sobrino
ca99680ce9 docs: fix errata in RMM-EL3 Communication Interface documentation
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: I6d6b7ff084cc731470e873cfdf37beeec0d3635a
2023-11-30 17:00:06 +02:00
Lauren Wehrmeister
2e1e1664c0 Merge "fix(cpus): workaround for Neoverse V2 erratum 2618597" into integration 2023-11-29 23:40:05 +01:00
Bipin Ravi
c0f8ce5379 fix(cpus): workaround for Neoverse V2 erratum 2618597
Neoverse V2 erratum 2618597 is a Cat B erratum that applies to
all revisions <= r0p1 and is fixed in r0p2. The workaround is to
disable the use of the Full Retention power mode in the core (setting
WFI_RET_CTRL and WFE_RET_CTRL in IMP_CPUPWRCTLR_EL1 to 0b000).

SDEN can be found here:
https://developer.arm.com/documentation/SDEN-2332927/latest

Change-Id: I23a81275d1e40cae39e6897093d6cdd3e11c08ea
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
2023-11-29 15:35:26 -06:00
Lauren Wehrmeister
9d4819a094 Merge "fix(cpus): workaround for Neoverse V2 erratum 2662553" into integration 2023-11-29 16:07:16 +01:00
Yann Gautier
324a63cd46 Merge "fix(docs): revise the description of REGISTER_CRYPTO_LIB" into integration 2023-11-29 13:18:43 +01:00
zhiyang.shi
5710229f9e fix(docs): revise the description of REGISTER_CRYPTO_LIB
verify_hash should be placed before calc_hash
align with crypto_mod.h

Change-Id: I536125502d83bb732cf70fbe516d5fe009dc95fe
Signed-off-by: zhiyang.shi <zhiyang.shi@cixtech.com>
2023-11-29 14:39:31 +08:00
Mark Dykes
ad8669426e Merge "feat(security): add support for SLS mitigation" into integration 2023-11-29 00:11:29 +01:00
Bipin Ravi
5305809a73 Merge changes from topic "sm/errata" into integration
* changes:
  fix(cpus): workaround for Cortex-A78C erratum 2743232
  fix(cpus): workaround for Neoverse V1 erratum 2348377
  fix(cpus): workaround for Cortex-X3 erratum 2779509
2023-11-27 22:01:31 +01:00
Olivier Deprez
5fddf53c16 Merge changes from topic "mb/deprecate-rss-for-fvp" into integration
* changes:
  refactor(fvp): remove RSS usage
  refactor(rss)!: remove PLAT_RSS_NOT_SUPPORTED build option
2023-11-23 17:00:55 +01:00
Manish V Badarkhe
9873580997 docs(changelog): changelog for v2.10 release
Added changelog for v2.10 release.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Change-Id: Id06263047fcc1ec60e82f85cd09e2e4bc95830f5
2023-11-22 11:52:02 +00:00
Bipin Ravi
538516f5d3 feat(security): add support for SLS mitigation
This patch enables support for the gcc compiler option "-mharden-sls",
the default is not to use this option. Setting HARDEN_SLS=1 sets
"-mharden-sls=all" that enables all hardening against straight line
speculation.

Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
Change-Id: I59f5963c22431571f5aebe7e0c5642b32362f4c9
2023-11-21 15:27:00 -06:00
Bipin Ravi
912c4090ff fix(cpus): workaround for Neoverse V2 erratum 2662553
Neoverse V2 erratum 2662553 is a Cat B erratum that applies to all
revisions <= r0p1 and is fixed in r0p2.
The workaround is to set L2 TQ size statically to it's full size.

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

Change-Id: I3bc43e7299c17db8a6771a547515ffb2a172fa0f
Signed-off-by: Bipin Ravi <bipin.ravi@arm.com>
2023-11-21 15:20:46 -06:00
Manish Pandey
ccd8c0230c Merge "Revert "docs(changelog): changelog for v2.10 release"" into integration 2023-11-21 14:46:50 +01:00
Manish Pandey
256c1c60e0 Revert "docs(changelog): changelog for v2.10 release"
This reverts commit 0abbfab320.

Reason for revert: Changelog was based on rc0 tag but we got few more patches after that which were not captured.

Change-Id: I9829f2b6dc09f0bd5c538845cbae051f6e4c8a75
2023-11-21 14:37:29 +01:00