Commit graph

2048 commits

Author SHA1 Message Date
Boyan Karatotev
23302d4a53 fix(xlat): remove xlat_mpu
The only platform to use this is fvp_r. As this platform is now gone, so
is the need for this library. Support for it never went out of
"experimental" so it does not appear to be finished.

Change-Id: I76499b92ca4368651330f17dc80803991158cc36
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-04-09 11:02:40 +01:00
Boyan Karatotev
2cadf21bc8 fix(plat): remove fvp_r
The platform has not been maintained for some years and is generally
broken. Remove it to avoid confusion.

Change-Id: I93d832d51e114689ec79969af5d96071a03f4a88
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2025-04-08 14:27:06 +01:00
Manish V Badarkhe
10639cc9af Merge changes from topic "xlnx_fix_gen_uniq_var" into integration
* changes:
  fix(psci): avoid altering function parameters
  fix(services): avoid altering function parameters
  fix(common): ignore the unused function return value
  fix(psci): modify variable conflicting with external function
  fix(delay-timer): create unique variable name
2025-04-03 17:34:58 +02:00
Per Larsen
5141de1443 fix(build): enable fp during fp save/restore
Newer compilers such as clang/LLVM 19 flag uses of floating point
instructions when the architecture does not allow for it. We can
temporarily enable the use of floating point operations where it
it is safe and necessary for the build to succeed.

Change-Id: I1a832f846915c35792684906c94aef81c1f72d63
Signed-off-by: Andrei Homescu <ahomescu@google.com>
Signed-off-by: Per Larsen <perlarsen@google.com>
2025-04-03 02:17:36 +00:00
Govindraj Raja
ac9f4b4da6 fix(cpus): remove errata setting PF_MODE to conservative
The erratum titled “Disabling of data prefetcher with outstanding
prefetch TLB miss might cause a deadlock” should not be handled within
TF-A. The current workaround attempts to follow option 2 but
misapplies it. Specifically, it statically sets PF_MODE to
conservative, which is not the recommended approach. According to the
erratum documentation, PF_MODE should be configured in conservative
mode only when we disable data prefetcher however this is not done
in TF-A and thus the workaround is not needed in TF-A.

The static setting of PF_MODE in TF-A does not correctly address the
erratum and may introduce unnecessary performance degradation on
platforms that adopt it without fully understanding its implications.

To prevent incorrect or unintended use, the current implementation of
this erratum workaround should be removed from TF-A and not adopted by
platforms.

List of Impacted CPU's with Errata Numbers and reference to SDEN -

Cortex-A78  - 2132060 - https://developer.arm.com/documentation/SDEN1401784/latest
Cortex-A78C - 2132064 - https://developer.arm.com/documentation/SDEN-2004089/latest
Cortex-A710 - 2058056 - https://developer.arm.com/documentation/SDEN-1775101/latest
Cortex-X2   - 2058056 - https://developer.arm.com/documentation/SDEN-1775100/latest
Cortex-X3   - 2070301 - https://developer.arm.com/documentation/SDEN2055130/latest
Neoverse-N2 - 2138953 - https://developer.arm.com/documentation/SDEN-1982442/latest
Neoverse-V1 - 2108267 - https://developer.arm.com/documentation/SDEN-1401781/latest
Neoverse-V2 - 2331132 - https://developer.arm.com/documentation/SDEN-2332927/latest

Change-Id: Icf4048508ae070b2df073cc46c63be058b2779df
Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
2025-03-31 01:00:27 +01:00
Govindraj Raja
2377542785 Merge changes from topic "xlnx_fix_gen_datatype_cast" into integration
* changes:
  fix(psci): add const qualifier
  fix(el3-runtime): add const qualifier
  fix(bl31): add const qualifier
  fix(console): typecast expressions to match data type
  fix(arm-drivers): typecast expressions to match data type
  fix(arm-drivers): align essential type categories
  fix(arm-drivers): typecast expression to match data type
2025-03-27 15:53:57 +01:00
Manish Pandey
518b278bed Merge changes from topic "hm/handoff-aarch32" into integration
* changes:
  refactor(arm): simplify early platform setup functions
  feat(bl32): enable r3 usage for boot args
  feat(handoff): add lib to sp-min sources
  feat(handoff): add 32-bit variant of SRAM layout
  feat(handoff): add 32-bit variant of ep info
  fix(aarch32): avoid using r12 to store boot params
  fix(arm): reinit secure and non-secure tls
  refactor(handoff): downgrade error messages
2025-03-24 17:29:57 +01:00
Bipin Ravi
b78c307ca6 Merge changes from topic "ar/cvereorder" into integration
* changes:
  chore(cpus): rearrange the errata and cve in order in Cortex-X4
  chore(cpus): rearrange the errata and cve in order in Neoverse-V3
2025-03-21 17:22:00 +01:00
Bipin Ravi
6059e4232d Merge "chore(cpus): rearrange cve and errata order in Cortex-X3" into integration 2025-03-21 17:21:18 +01:00
Bipin Ravi
eeb16181f5 Merge changes from topic "ar/cvereorder" into integration
* changes:
  chore(cpus): fix cve order in Neoverse-V2
  chore(cpus): rearrange the errata and cve in order in Cortex-A710
2025-03-21 17:12:25 +01:00
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
4c7fa977b7 Merge "chore(cm): add MDCR_EL3.RLTE to context management" into integration 2025-03-21 12:25:42 +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
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
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
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
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
John Powell
fcf2ab71ac fix(cpus): workaround for Cortex-A715 erratum 2804830
Cortex-A715 erratum 2804830 applies to r0p0, r1p0, r1p1 and r1p2,
and is fixed in r1p3.

Under some conditions, writes of a 64B-aligned, 64B granule of
memory might cause data corruption without this workaround. See SDEN
for details.

Since this workaround disables write streaming, it is expected to
have a significant performance impact for code that is heavily
reliant on write streaming, such as memcpy or memset.

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

Change-Id: Ia12f6c7de7c92f6ea4aec3057b228b828d48724c
Signed-off-by: John Powell <john.powell@arm.com>
2025-03-17 18:17:48 +01:00
Harrison Mutai
e13d027b70 refactor(handoff): downgrade error messages
Some APIs, like `transfer_list_check_header`, are used preemptively to
determine if a new TL needs to be initialized. If we validate a TL and
anticipate its contents to be invalid or corrupted, logging these as
error message isn't helpful.

Change-Id: Ic22378828548d48f73aa74d494f110fbd11857f4
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2025-03-17 16:56:28 +00:00
Arvind Ram Prakash
484befbfcb fix(cpufeat): add feat_hcx check before enabling FEAT_MOPS
This patch also checks for FEAT_HCX before enabling FEAT_MOPS
when INIT_UNUSED_NS_EL1 = 1 and adds build dependency check.

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Iff4a068aa392fc8d29e2e4da7a2e7df0b3104e65
2025-03-14 16:20:24 +01:00
Soby Mathew
c5ea3faca1 Merge "feat(rmmd): add FEAT_MEC support" into integration 2025-03-12 11:19:04 +01:00
Tushar Khandelwal
7e84f3cf90 feat(rmmd): add FEAT_MEC support
This patch provides architectural support for further use of
Memory Encryption Contexts (MEC) by declaring the necessary
registers, bits, masks, helpers and values and modifying the
necessary registers to enable FEAT_MEC.

Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com>
Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Change-Id: I670dbfcef46e131dcbf3a0b927467ebf6f438fa4
2025-03-11 14:46:00 -05:00
Maheedhar Bollapalli
e64cdee4da fix(psci): avoid altering function parameters
This corrects the MISRA violation C2012-17.8:
A function parameter should not be modified.
Local variable is declared and used to process the value
from the argument.

Change-Id: Ia757db4903132794623dbf92ff8cecc9b40f170d
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-09 22:11:43 +05:30
Maheedhar Bollapalli
0839cfc980 fix(psci): modify variable conflicting with external function
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 function declaration

Change-Id: I2f109242b6dd3b3c5e9289881e3dd5466c74fcb5
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-09 22:08:48 +05:30
Nithin G
7b970841ad fix(psci): add const qualifier
This corrects the MISRA violation C2012-8.13:
A pointer should point to a const-qualified type whenever possible.
Added const qualifier to pointer in the function arguments.

Change-Id: Id3d4aa528f275973a37c0b9af04495632cb2dda3
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-09 22:02:54 +05:30
Nithin G
54c9c68a49 fix(el3-runtime): add const qualifier
This corrects the MISRA violation C2012-8.13:
A pointer should point to a const-qualified type whenever possible.
Added const qualifier to pointer in the function arguments.

Change-Id: Idf4b8ea7842304849242a06d6ada73f11afc8cde
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-09 22:02:54 +05:30
Govindraj Raja
98a7cdb25b Merge "fix(errata-abi): add support for handling split workarounds" into integration 2025-03-07 17:50:23 +01:00
Arvind Ram Prakash
bbff267b6f fix(errata-abi): add support for handling split workarounds
Certain erratum workarounds like Neoverse N1 1542419, need a part
of their mitigation done in EL3 and the rest in lower EL. But currently
such workarounds return HIGHER_EL_MITIGATION which indicates that the
erratum has already been mitigated by a higher EL(EL3 in this case)
which causes the lower EL to not apply it's part of the mitigation.

This patch fixes this issue by adding support for split workarounds
so that on certain errata we return AFFECTED even though EL3 has
applied it's workaround. This is done by reusing the chosen field of
erratum_entry structure into a bitfield that has two bitfields -
Bit 0 indicates that the erratum has been enabled in build,
Bit 1 indicates that the erratum is a split workaround and should
return AFFECTED instead of HIGHER_EL_MITIGATION.

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

Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
Change-Id: Iec94d665b5f55609507a219a7d1771eb75e7f4a7
2025-03-07 17:02:25 +01:00
Maheedhar Bollapalli
858dc35cfd fix(el3-runtime): add missing curly braces
This corrects the MISRA violation C2012-15.6:
The body of an iteration-statement or a selection-statement shall
be a compound-statement.
Enclosed statement body within the curly braces.

Change-Id: I14a69f79aba98e243fa29a50914431358efa2a49
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-07 13:22:18 +01:00
Maheedhar Bollapalli
bd7ad5e684 fix(locks): add missing curly braces
This corrects the MISRA violation C2012-15.6:
The body of an iteration-statement or a selection-statement shall
be a compound-statement.
Enclosed statement body within the curly braces.

Change-Id: Ie33b310f6406d77a7a2ebd94cf54c2a2968f8644
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-07 13:22:18 +01:00
Maheedhar Bollapalli
c7b0a28d32 fix(psci): add missing curly braces
This corrects the MISRA violation C2012-15.6:
The body of an iteration-statement or a selection-statement shall
be a compound-statement.
Enclosed statement body within the curly braces.

Change-Id: I8b656f59b445e914dd3f47e3dde83735481a3640
Signed-off-by: Nithin G <nithing@amd.com>
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
2025-03-07 13:22:18 +01:00
Manish V Badarkhe
936a78b581 Merge "fix(xlat_tables_v2): zeromem to clear all tables" into integration 2025-02-28 18:38:38 +01:00