Commit graph

12707 commits

Author SHA1 Message Date
Harrison Mutai
29b11baf6b chore: reformat sphinx configuration
Format the configuration file to follow our coding guidelines and common
Python style conventions.

Change-Id: Ic83372287db08df0662f562f7683a02ddff0bac8
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
2023-06-05 12:30:39 +01:00
Sandrine Bailleux
7f126ccff6 Merge changes from topic "cot_cca_nvctr" into integration
* changes:
  feat(fvp): mock support for CCA NV ctr
  feat(auth): add CCA NV ctr to CCA CoT
  feat(build): pass CCA NV ctr option to cert_create
  feat(cert-create): add new option for CCA NV ctr
2023-06-05 08:13:33 +02:00
Sandrine Bailleux
463655cc81 Merge "fix(measured-boot): don't strip last non-0 char" into integration 2023-06-02 10:02:47 +02:00
Sandrine Bailleux
9b5c0fcdba Merge changes from topic "hm/memmap-feat" into integration
* changes:
  build(bl32): add symbols for memory layout
  build(bl31): add symbols for memory layout
  build(bl2): add symbols for memory layout
  build(bl1): add symbols for memory layout
  refactor: improve readability of symbol table
2023-06-01 14:36:46 +02:00
Sandrine Bailleux
ff31094a0d Merge changes from topic "sb/maintainters-process" into integration
* changes:
  docs: clarify maintainers election process
  docs: consolidate code review process documentation
2023-06-01 13:42:16 +02:00
Sandrine Bailleux
0df5cf1893 docs: clarify maintainers election process
Add a new page in TF-A documentation for clarifying the process to
elect a new maintainer. This builds on top of the Trusted Firmware
process [1], with the following TF-A specific details:

 - Must have contributed to the project for at least a couple of years.
 - Must dedicate at least 2 hours a week for maintainer duties.
 - Details about the election process. In particular, setting a
   one-calendar-week deadline for other maintainers to raise
   objections.

[1] https://developer.trustedfirmware.org/w/collaboration/project-maintenance-process/

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: Ibef08bbbd4d18cd7aea13e01ba570972a7ee808d
2023-06-01 13:41:09 +02:00
Sandrine Bailleux
ca4febac0c docs: consolidate code review process documentation
From the page listing the maintainers and code owners [1], add a link
to the code review guidelines page [2], which in turn has a link to
the tf.org code review process [3].

Before that patch, both pages [1] and [2] had a link to
[3]. Hopefully, this change will guide the reader better so they don't
miss out on any information.

Additionally, move some of the information from the top of page [1]
into page [2] and add extra details about the code review process used
in TF-A and how that get translated in Gerrit.

[1] https://trustedfirmware-a.readthedocs.io/en/latest/about/maintainers.html
[2] https://trustedfirmware-a.readthedocs.io/en/latest/process/code-review-guidelines.html
[3] https://developer.trustedfirmware.org/w/collaboration/project-maintenance-process/

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Change-Id: I56562a72443f03fff16077dadc411ef4ee78666d
2023-06-01 13:41:09 +02:00
Lauren Wehrmeister
0cfa06b22b Merge changes from topic "bk/errata_refactor" into integration
* changes:
  feat(cpus): wrappers to propagate AArch32 errata info
  feat(cpus): add a way to automatically report errata
  feat(cpus): add a concise way to implement AArch64 errata
  refactor(cpus): convert print_errata_status to C
  refactor(cpus): rename errata_report.h to errata.h
  refactor(cpus): move cpu_ops field defines to a header
2023-05-31 23:06:53 +02:00
Jimmy Brisson
b85bcb8ec9 fix(measured-boot): don't strip last non-0 char
With the current implementation of stripping the last null
byte from a string, there was no way to get the TF-M measured
boot test suite to pass. It would expect the size of the string
passed into extend measurement to be unaffected by the call.

This fix should allow passing a string with the null char
pre-stripped, allowing the tests to exclude the null char in
their test data and not have the length decremented.

Further, This patch adds an early exit if either the version
or sw_type is larger than its buffer. Without this check,
it may be possible to pass a length one more than the maximum,
and if the last element is a null, the length will be truncated
to fit. This is instead suppsed to return an error.

Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com>
Change-Id: I98e1bb53345574d4645513009883c6e7b6612531
2023-05-31 16:40:43 +02:00
Olivier Deprez
a0a4bf488d Merge "feat: define memory ranges for tc platform" into integration 2023-05-31 09:40:43 +02:00
Madhukar Pappireddy
3f52d599f4 Merge "docs: fix syntax error in note" into integration 2023-05-30 15:08:09 +02:00
Boyan Karatotev
34c51f327d feat(cpus): wrappers to propagate AArch32 errata info
AArch32 is not being ported to the errata framework. However, the
runtime errata list is needed at runtime for the upcoming errata ABI.
Add wrappers to populate this information and make it accessible in the
same way as AArch64.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I084720f34d6ed4e00e94b09babd3c90a5393298a
2023-05-30 09:31:15 +01:00
Boyan Karatotev
4f748cc44c feat(cpus): add a way to automatically report errata
Using the errata framework per-cpu data structure, errata can all be
reported automatically through a single standard errata reporter which
can replace the cpu-specific ones.

This reporter can also enforce the ordering requirement of errata.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I7d2d5ac5bcb9d21aed0d560d7d23919a323ffdab
2023-05-30 09:31:15 +01:00
Boyan Karatotev
3f4c1e1e7b feat(cpus): add a concise way to implement AArch64 errata
Errata implementation involves adding a lot of boilerplate to random
places with just conventions on how to do them. Copy pasting is the
usual method for doing this. The result is an error-prone and verbose
patch that is a nightmare to get through review.

Errata workarounds have a very large degree of similarity - most of them
involve setting a bit at reset. As such most of the boilerplate is not
strictly necessary. To solve this, add a collection of assembly macros
to wrap errata implementations such that only the actual mitigations
need to be written. A new erratum mitigation looks something like:

  workaround_reset_start cortex_a77, ERRATUM(1925769), ERRATA_A77_1925769
    sysreg_bit_set CORTEX_A77_CPUECTLR_EL1, CORTEX_A77_CPUECTLR_EL1_BIT_8
  workaround_reset_end cortex_a77, ERRATUM(1925769)

  check_erratum_ls cortex_a77, ERRATUM(1925769), CPU_REV(1, 1)

Note, that the long comment on every mitigation is missing. This is on
purpose, as this new format includes all of its contents into an easily
readable format.

The workaround wrappers add an erratum entry (24 bytes) to a per-cpu
data structure which can then be read by a standard reset function to
apply all errata automatically. This has the added benefit of collecting
all errata TF-A knows about in a central way, which was previously
missing. This can then be used at runtime with the errata ABI.

If an erratum doesn't fit this standard definition (eg. the
CVE_2022_23960), it can progressively be unwrapped to the old
convention. The only differences are that the naming format is slightly
more verbose and a call to add_erratum_entry is needed to inform the
framework about the errata.

Finally, the internal workaround names change a tiny bit, especially
CVEs.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Iac644f85dcf85b8279b25e83baf1e7d08b253b16
2023-05-30 09:31:15 +01:00
Boyan Karatotev
dd9fae1ce0 refactor(cpus): convert print_errata_status to C
The function is called in a fully initialised C environment and calls
into other C functions. The Aarch differences are minimal and are hidden
by the pre-existing headers. Converting it results into cleaner code
that is the same across both Aarch64 and Aarch32.

To avoid having to do very ugly pointer arithmetic, define a C struct
for the cpu_ops for both Aarch64 and Aarch32.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Idc07c4064e03143c88a4a0e2d10ceda70ba19a50
2023-05-30 09:31:15 +01:00
Boyan Karatotev
6bb96fa6d6 refactor(cpus): rename errata_report.h to errata.h
The ERRATA_XXX macros, used in cpu_helpers.S, are necessary for the
check_errata_xxx family of functions. The CPU_REV should be used in the
cpu files but for whatever reason the values have been hard-coded so far
(at the cost of readability). It's evident this file is not strictly for
status reporting.

The new purpose of this file is to make it a one-stop-shop for all
things errata.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I1ce22dd36df5aa0bcfc5f2772251f91af8703dfb
2023-05-30 09:31:15 +01:00
Boyan Karatotev
007433d8cf refactor(cpus): move cpu_ops field defines to a header
The cpu_macros.S file is loaded with lots of definitions for the cpu_ops
structure. However, since they are defined as .equ directives they are
inaccessible for C code. Convert them to #defines, put them into order,
refactor them for readability, and extract them to a separate file to
make this possible.

This has the benefit of removing some Aarch differences and a lot of
duplicate code.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I72861794b6c9131285a9297d5918822ed718b228
2023-05-30 09:31:15 +01:00
Joanna Farley
c0d8ee3861 Merge "fix(zynqmp): handling of type el3 interrrupts" into integration 2023-05-26 10:19:10 +02:00
laurenw-arm
02552d45e5 feat(fvp): mock support for CCA NV ctr
AEM FVP does not have a third CCA NV counter so the
implementation will fake it by returning the Trusted
NV counter value when the caller requests the CCA NV
counter. This allows us to use the CCA CoT on AEM FVP
nonetheless.

The FVP platform port now gets its own version of
plat_get_nv_ctr() as it now need to diverge from the
common implementation provided at the Arm development
platforms level.

Change-Id: I3258f837249a539d943d6d783406ba222bd4554e
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
2023-05-25 16:40:43 -05:00
laurenw-arm
e3b1cc0c51 feat(auth): add CCA NV ctr to CCA CoT
Modifying the CCA CoT description to put the CCA content certificate
under the new CCA NV counter.

Change-Id: Ib962cef5eaa15bb9ccce86012f21327d29d4adad
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
2023-05-25 16:40:43 -05:00
laurenw-arm
0f19b7aada feat(build): pass CCA NV ctr option to cert_create
Modifying build system to pass the new CCA NV counter options
ccafw_nvctr to  cert_create tool in context of CCA COT

Change-Id: I9de2cdc041d96bc19180c3189628ed23e68a992b
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
2023-05-25 16:40:43 -05:00
laurenw-arm
60753a6329 feat(cert-create): add new option for CCA NV ctr
Extends cert_create tool with a new option for CCA NV
counter: ccafw_nvctr.

And changes the non-volatile counter used to protect
the CCA Content Certificate from the Trusted FW NV counter
to the CCA FW NV counter in the CCA CoT description.

Change-Id: I27f3ab2e25809f0dcc56fa05e5c3a25a2e861ef6
Signed-off-by: Lauren Wehrmeister <lauren.wehrmeister@arm.com>
2023-05-25 16:40:43 -05:00
Manish Pandey
60df3d75ed Merge "fix(tsp): flush uart console" into integration 2023-05-25 16:45:15 +02:00
Manish Pandey
4bb0cdc159 Merge changes I31ec0001,Ib06cd024,I7c11f15d,Ie0d5d4c8,I285f3b59, ... into integration
* changes:
  fix(el3-spmc): correctly account for emad_offset
  refactor(el3-spmc): avoid unnecessarily revalidating offset
  fix(el3-spmc): only call spmc_shm_check_obj() on complete objects
  refactor(spmc): assert on out-of-bounds emad access
  refactor(el3-spmc): spmc_shmem_obj_get_emad() will never fail
  fix(el3-spmc): validate descriptor headers
  fix(el3-spmc): use version-dependent minimum descriptor length
  refactor(el3-spmc): check emad_count offset
2023-05-25 12:35:46 +02:00
Joanna Farley
16cb3be875 Merge changes from topic "xlnx_smcc_soc_id" into integration
* changes:
  feat(versal-net): add support for SMCC ARCH SOC ID
  feat(versal): add support for SMCC ARCH SOC ID
  refactor(versal-net): move macros to common header
  feat(xilinx): add support to get chipid
2023-05-24 16:43:25 +02:00
Joanna Farley
76778ffa34 Merge "fix(zynqmp): make zynqmp_devices structure smaller" into integration 2023-05-24 16:37:33 +02:00
Michal Simek
7e3e79995a fix(zynqmp): make zynqmp_devices structure smaller
Pack the structure and make id/ver smaller and sorted.
The change saves 400bytes in RODATA section.

Change-Id: I8bcbe8fd589ba193551a0dd2cd19572516252e73
Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-05-24 15:37:41 +02:00
Madhukar Pappireddy
de40404b7c Merge "fix(brcm): fix misspelled header inclusion guard" into integration 2023-05-24 15:32:48 +02:00
Joanna Farley
e80770449a Merge changes from topic "xilinx-ipi" into integration
* changes:
  feat(xilinx): fix IPI calculation for Versal/NET
  feat(xilinx): setup local/remote id in header
  feat(xilinx): clean macro names
  fix(zynqmp): do not export apu_ipi
  fix(zynqmp): remove unused headers
  feat(xilinx): move IPI related macros to plat_ipi.h
2023-05-24 14:40:51 +02:00
Joanna Farley
32d6396aa6 Merge "feat(versal-net): add the IPI CRC checksum macro support" into integration 2023-05-24 14:39:05 +02:00
Soby Mathew
b709f12db3 Merge "feat(rme): save PAuth context when RME is enabled" into integration 2023-05-24 14:23:38 +02:00
Akshay Belsare
1873e7f7d8 feat(versal-net): add support for SMCC ARCH SOC ID
Add support for SMCCC_ARCH_SOC_ID as per SMC Calling Convention for
Versal NET platform.
The SMCC ARCH SOC ID call is used by system software to obtain the SiP
defined SoC identification details.

Change-Id: I6648051c7f5fa27d2f02080209da36ee8d5a9d95
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
2023-05-24 14:09:04 +02:00
Akshay Belsare
079c6e2403 feat(versal): add support for SMCC ARCH SOC ID
Add support for SMCCC_ARCH_SOC_ID as per SMC Calling Convention for
Versal platform.
The SMCC ARCH SOC ID call is used by system software to obtain the SiP
defined SoC identification details.

Change-Id: I1466a9ad1bc8dde1cda516ddd3edbaa6a5941237
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
2023-05-24 14:08:54 +02:00
Akshay Belsare
4265bcae14 refactor(versal-net): move macros to common header
Move the macros to common header from platform specific folder, so that
the same macros can be re-used in other platforms.

Change-Id: I355b024f5e870c6fc104598bc571dbaa29503ae2
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
2023-05-24 14:08:45 +02:00
Akshay Belsare
0563601f03 feat(xilinx): add support to get chipid
Add support for PM API SYS to get the chip ID from the target.
The API calls the IPI command to read the Chip idcode and revision.

Change-Id: Id4d7d812cbf77c5e2fc7785b8afb379214f8dd19
Signed-off-by: Akshay Belsare <akshay.belsare@amd.com>
2023-05-24 14:08:39 +02:00
Joanna Farley
545330b844 Merge "fix(versal-net): fix BLXX memory limits for user defined values" into integration 2023-05-24 14:06:39 +02:00
Joanna Farley
74bda905e8 Merge changes Ica1f9786,Ic96e3680 into integration
* changes:
  fix(versal): fix BLXX memory limits for user defined values
  fix(zynqmp): fix BLXX memory limits for user defined values
2023-05-24 14:03:17 +02:00
Michal Simek
a80da3899a fix(versal-net): fix BLXX memory limits for user defined values
When compiling with user defined areas of memory the platform code
calculates the size with (base + size - 1).  However, the linker
file aligns section on a page boundary. So having the -1 in
the size calculations leads to an error message looking like this:

bl31.elf section `coherent_ram' will not fit in region `RAM'
aarch64-buildroot-linux-uclibc-ld: region `RAM' overflowed by 1 byte

While at it fix all other occurences of predefined values that were
calculated with -1.

Fixes: 1d333e6909 ("feat(versal-net): add support for Xilinx
Versal NET platform")
Change-Id: I4455f63ee3ad52369f517a7d8d3627faf0b28c0f
Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-05-24 12:40:46 +02:00
Shruti Gupta
13cc1aa70a feat(rme): save PAuth context when RME is enabled
This patch enables CTX_INCLUDE_PAUTH_REGS for RME builds.
The RMM-EL3 specification is also updated to reflect the changes
and also version of the same is bumped from 0.1 to 0.2.

Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
Change-Id: I2e96a592d2b75abaee24294240c1727c5ceba420
2023-05-24 10:56:40 +01:00
Ilias Apalodimas
f123b91fdd fix(versal): fix BLXX memory limits for user defined values
When compiling with user defined areas of memory the platform code
calculates the size with (base + size - 1).  However, the linker file
aligns section on a page boundary.  So having the -1 in the size
calculations leads to an error message looking like this:

bl31.elf section `coherent_ram' will not fit in region `RAM'
aarch64-buildroot-linux-uclibc-ld: region `RAM' overflowed by 1 byte

While at it fix all other occurences of predefined values that were
calculated with -1

Fixes: commit f91c3cb1df ("arm64: versal: Add support for new Xilinx Versal ACAPs")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Change-Id: Ica1f97867b701e7fcd60ea8ea07d2ae96c485443
2023-05-24 10:46:49 +03:00
Ilias Apalodimas
8ce2fbffe3 fix(zynqmp): fix BLXX memory limits for user defined values
When compiling with user defined areas of memory the platform code
calculates the size with (base + size - 1).  However, the linker file
aligns section on a page boundary.  So having the -1 in the size
calculations leads to an error message looking like this:

bl31.elf section `coherent_ram' will not fit in region `RAM'
aarch64-buildroot-linux-uclibc-ld: region `RAM' overflowed by 1 byte

Commit 9b4ed0af02 ("feat(plat/zynqmp): fix section `coherent_ram' will not fit in region `RAM'")
applied a similar fix, but only in the predefined for BL31LIMIT/BASE.

While at it fix all other occurences of predefined values that were
calculated with -1

Fixes: 01555332fa ("zynqmp: Revise memory configuration options")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Change-Id: Ic96e36808d01f6bb92e6839cec92fc52320dd3f3
2023-05-24 10:46:49 +03:00
Sandrine Bailleux
2abbb457fa Merge "fix(intel): update checking for memcpy and memset" into integration 2023-05-24 08:31:09 +02:00
Sandrine Bailleux
816c27fbba Merge changes I38545567,I2f52d3ea into integration
* changes:
  feat(intel): restructure sys mgr for S10/N5X
  feat(intel): restructure sys mgr for Agilex
2023-05-23 17:43:00 +02:00
Madhukar Pappireddy
a2ecddde4b Merge "fix(ti): remove check for zero value in BL31 boot args" into integration 2023-05-23 17:15:12 +02:00
Olivier Deprez
6a6fdd16d0 Merge "docs: fix rendering for code blocks in SPM" into integration 2023-05-23 16:01:02 +02:00
Sandrine Bailleux
f7ed5bea1d Merge "feat(intel): setup SEU ERR read interface for FP8" into integration 2023-05-23 15:43:21 +02:00
Manish Pandey
ce0f98e80f Merge "docs(maintainers): add Yann Gautier in TF-A maintainers list" into integration 2023-05-23 15:40:41 +02:00
Jit Loon Lim
b653f3caf0 feat(intel): restructure sys mgr for S10/N5X
This patch is to restructure system manager. Move platform dependent
MACROs to individual platform system manager. Common system manager will
remain for those common declaration only.

Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: I385455671413e154d04a879d33fdd774fcfefbd6
2023-05-23 21:14:07 +08:00
Jit Loon Lim
6197dc98fe feat(intel): restructure sys mgr for Agilex
This patch is to restructure system manager. Move platform dependent
MACROs to individual platform system manager. Common system manager will
remain for those common declaration only.

Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: I2f52d3eaf47716f7dfc636bbf1a23d68a04f39cb
2023-05-23 21:13:05 +08:00
Jit Loon Lim
c418064eb5 fix(intel): update checking for memcpy and memset
Add checking on the size of source data does not exceed source size
when using memcpy and memset.

Add checking on the size of source data in FPGA Crypto Service does
not exceed the maximum of expected data size and does not meet the
minimum of expected data size.

Signed-off-by: Phui Kei Wong <phui.kei.wong@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
Change-Id: Idb18f05c18d9142fbe703c3f4075341d179d8bad
2023-05-23 21:09:01 +08:00