Commit graph

134 commits

Author SHA1 Message Date
Kathleen Capella
fd1479d919 fix(doc): match boot-order size to implementation
Docs had boot-order field as being u32 but code uses uint16_t.
FF-A specification does not specify a required size.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Change-Id: Ia4c3fc66b9e733ea1417d34c2601bce1f81c4d32
2023-05-17 16:25:31 -04:00
J-Alves
cc63ff9762 docs(spm): add memory sharing documentation
Add documentation that explains implementation specific
relevant information from the update done to FF-A v1.1
memory sharing in Hafnium.

Change-Id: Ifc3c6b86c0545d53331207b017b990427ee84f2d
Signed-off-by: J-Alves <joao.alves@arm.com>
2023-05-12 09:32:21 +01:00
Manish Pandey
9202d51990 refactor(ras): replace RAS_EXTENSION with FEAT_RAS
The current usage of RAS_EXTENSION in TF-A codebase is to cater for two
things in TF-A :
1. Pull in necessary framework and platform hooks for Firmware first
   handling(FFH) of RAS errors.
2. Manage the FEAT_RAS extension when switching the worlds.

FFH means that all the EAs from NS are trapped in EL3 first and signaled
to NS world later after the first handling is done in firmware. There is
an alternate way of handling RAS errors viz Kernel First handling(KFH).
Tying FEAT_RAS to RAS_EXTENSION build flag was not correct as the
feature is needed for proper handling KFH in as well.

This patch breaks down the RAS_EXTENSION flag into a flag to denote the
CPU architecture `ENABLE_FEAT_RAS` which is used in context management
during world switch and another flag `RAS_FFH_SUPPORT` to pull in
required framework and platform hooks for FFH.

Proper support for KFH will be added in future patches.

BREAKING CHANGE: The previous RAS_EXTENSION is now deprecated. The
equivalent functionality can be achieved by the following
2 options:
 - ENABLE_FEAT_RAS
 - RAS_FFH_SUPPORT

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I1abb9ab6622b8f1b15712b12f17612804d48a6ec
2023-05-09 13:19:22 +01:00
Madhukar Pappireddy
e601729119 docs(spm): support for handling Group0 interrupts
Please refer the doc update.

Change-Id: Ib79fae1296bc28fa9bd0cd79609d6153bb57519b
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2023-05-01 13:29:48 -05:00
Manish V Badarkhe
1cf3e2f0a8 feat(fvp): add Event Log maximum size property in DT
Updated the code to get and set the 'tpm_event_log_max_size' property
in the event_log.dtsi.

In this change, the maximum Event Log buffer size allocated by BL1 is
passed to BL2, rather than both relying on the maximum Event Log buffer
size macro.

Change-Id: I7aa6256390872171e362b6f166f3f7335aa6e425
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-04-18 17:13:17 +02:00
Andre Przywara
d23acc9e4f refactor(amu): unify ENABLE_AMU and ENABLE_FEAT_AMUv1
So far we have the ENABLE_AMU build option to include AMU register
handling code for enabling and context switch. There is also an
ENABLE_FEAT_AMUv1 option, solely to protect the HAFGRTR_EL2 system
register handling. The latter needs some alignment with the new feature
scheme, but it conceptually overlaps with the ENABLE_AMU option.

Since there is no real need for two separate options, unify both into a
new ENABLE_FEAT_AMU name in a first step. This is mostly just renaming at
this point, a subsequent patch will make use of the new feature handling
scheme.

Change-Id: I97d8a55bdee2ed1e1509fa9f2b09fd0bdd82736e
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-03-27 19:36:00 +01:00
Madhukar Pappireddy
48fb931536 Merge "docs(spm): add other-s-interrupts-action field to sp manifest" into integration 2023-03-06 15:09:27 +01:00
Madhukar Pappireddy
83a6798708 Merge "docs: add interrupts-target field to sp manifest" into integration 2023-02-22 17:46:22 +01:00
Sandrine Bailleux
af4fee04b9 Merge changes from topic "mb/tos-fw-config-load-refactor" into integration
* changes:
  feat(spmd): map SPMC manifest region as EL3_PAS
  feat(fvp): update device tree with load addresses of TOS_FW config
  refactor(fvp): rename the DTB info structure member
  feat(fconf): rename 'ns-load-address' to 'secondary-load-address'
2023-02-10 10:05:12 +01:00
Manish V Badarkhe
05e5503021 feat(fconf): rename 'ns-load-address' to 'secondary-load-address'
The 'ns-load-address' property has been renamed to 'secondary-load-
address' in order to make it more generic. It can be used to copy
the configuration to any location, be it root, secure, or non-secure.

Change-Id: I122508e155ccd99082296be3f6b8db2f908be221
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2023-02-07 11:26:38 +00:00
Raghu Krishnamurthy
9b5a360f82 docs: add interrupts-target field to sp manifest
In order to support the ability to target a SPI interrupt to a
particular core, an impdef field "interrupts-target" has been added to
associate and interrupt id with an mpidr. The field is optional and if
not provided, existing SPMC behavior of routing to boot strap core is
maintained.

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: I78ccfb45cd9b411cca4b36ff940064fc9dcd1622
2023-02-05 06:37:53 -08:00
Joanna Farley
8b47f87a5f Merge "feat(optee): add loading OP-TEE image via an SMC" into integration 2023-02-03 00:42:17 +01:00
Soby Mathew
e3df3ffa11 Merge changes I1b092bc1,Ifc2461b4,I5176caa5 into integration
* changes:
  docs(rme): update RMM-EL3 Boot Manifest structure description
  feat(rme): read DRAM information from FVP DTB
  feat(rme): set DRAM information in Boot Manifest platform data
2023-02-01 17:03:22 +01:00
Jeffrey Kardatzke
05c69cf75e feat(optee): add loading OP-TEE image via an SMC
This adds the ability to load the OP-TEE image via an SMC called from
non-secure userspace rather than loading it during boot. This should
only be utilized on platforms that can ensure security is maintained up
until the point the SMC is invoked as it breaks the normal barrier
between the secure and non-secure world.

Signed-off-by: Jeffrey Kardatzke <jkardatzke@google.com>
Change-Id: I21cfa9699617c493fa4190f01d1cbb714e7449cc
2023-01-31 10:38:16 -08:00
AlexeiFedorov
1db295cf4b docs(rme): update RMM-EL3 Boot Manifest structure description
This patch updates description of RMM-EL3 Boot Manifest
structure and its corresponding diagram and tables with DRAM
layout data.

Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: I1b092bc1ad5f1c7909d25c1a0dc89c2b210ada27
2023-01-31 16:56:04 +01:00
Madhukar Pappireddy
ae1d9d9046 docs(spm): add other-s-interrupts-action field to sp manifest
Also, the `run-time-model` field is removed from SP manifest binding
as it is not supported by Hafnium(SPMC).

Change-Id: Id8a91b2608791667e6285b3c5b879ec84612149d
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2023-01-26 08:56:29 -06:00
Soby Mathew
d9c976b088 docs(rme): improve OOB instruction for RME
This patch reworks the existing OOB instructions for RME enabled
TF-A.

Signed-off-by: Soby Mathew <soby.mathew@arm.com>
Change-Id: Icaeaf48c7061feaad4b1bb92388954694705e45c
2023-01-26 15:59:06 +02:00
Alexei Fedorov
a0f256b033 Merge "fix(rmmd): add missing padding to RMM Boot Manifest and initialize it" into integration 2022-12-08 14:53:50 +01:00
Javier Almansa Sobrino
dc0ca64e4b fix(rmmd): add missing padding to RMM Boot Manifest and initialize it
This patch also:
     * Enforces the check of RES0 fields on EL3-RMM boot interface
       and manifest
     * Fixes a couple of nits on the EL3-RMM Boot Interface
       documentation.

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: Idb9e38f9fcda2ba0655646a1e2c4fdbabd5cdc40
2022-12-07 18:54:28 +00:00
Soby Mathew
b8dbfacc44 Merge "feat(rmm): add support for the 2nd DRAM bank" into integration 2022-12-07 06:03:38 +01:00
AlexeiFedorov
346cfe2b46 feat(rmm): add support for the 2nd DRAM bank
This patch adds support for RMM granules allocation
in FVP 2nd DRAM 2GB bank at 0x880000000 base address.
For ENABLE_RME = 1 case it also removes "mem=1G"
Linux kernel command line option in fvp-base-psci-common.dsti
to allow memory layout discovery from the FVP device tree.
FVP parameter 'bp.dram_size' - size of main memory in gigabytes
documented in docs/components/realm-management-extension.rst
is changed from 2 to 4.

Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: I174da4416ad5a8d41bf0ac89f356dba7c0cd3fe7
2022-12-06 12:29:43 +00:00
Govindraj Raja
f1910cc178 build: restrict usage of CTX_INCLUDE_EL2_REGS
CTX_INCLUDE_EL2_REGS is used to save/restore EL2 registers and
it should be only used when there is SPMD or RME enabled.

Make CTX_INCLUDE_EL2_REGS an internal macro and remove
from documentation.

Signed-off-by: Govindraj Raja <govindraj.raja@arm.com>
Change-Id: I6a70edfd88163423ff0482de094601cf794246d6
2022-12-01 12:04:40 +02:00
Olivier Deprez
02fd5a1763 Merge changes I97687f18,I91d5718b into integration
* changes:
  docs(spm): interrupt handling guidance FF-A v1.1 EAC0
  docs(spm): partition runtime model and schedule modes
2022-11-17 11:14:05 +01:00
Olivier Deprez
8fca0cdbee Merge changes from topic "ja/spm_doc" into integration
* changes:
  docs(spm): ff-a v1.1 indirect message
  docs(spm): s-el0 partition support update
2022-11-17 10:04:49 +01:00
Madhukar Pappireddy
06afdd1e7a docs(spm): interrupt handling guidance FF-A v1.1 EAC0
This patch documents the actions taken by Hafnium SPMC in response
to non-secure and secure interrupts.

Change-Id: I97687f188ca97aeb255e3e5b55d44ddf5d66b6e0
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2022-11-16 14:28:37 -06:00
Madhukar Pappireddy
03997f187c docs(spm): partition runtime model and schedule modes
This patch documents the support for partition runtime models, call
chains and schedule modes in Hafnium SPMC.

Change-Id: I91d5718bb2c21d475499e402f6f27076930336cb
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2022-11-16 13:34:32 -06:00
J-Alves
53e3b385f0 docs(spm): ff-a v1.1 indirect message
Update secure partition manager documentation to include
FF-A v1.1 indirect messaging implementation.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: Ifbca45347f775080ef98ac896d31650204318ba4
2022-11-16 15:29:45 +00:00
Manish V Badarkhe
71061819aa Merge changes If90a18ee,I02e88f8c,Iea447fb5,Ie0570481,Ieeb14cfc into integration
* changes:
  docs: add top level section numbering
  docs(build): clarify getting started section
  docs(build): clarify docs building instructions
  fix(docs): prevent a sphinx warning
  fix(docs): prevent a virtual environment from failing a build
2022-11-16 16:18:54 +01:00
Olivier Deprez
54c52bcb76 Merge "docs(spm): update FF-A manifest binding" into integration 2022-11-16 15:39:08 +01:00
Boyan Karatotev
c65bf2d134 docs: add top level section numbering
Top level sections are not numbered. Adding numbers makes referring to
sections easier. For example the Maintainers page changes from
"about/3.1" to simply "1.3.1".

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: If90a18ee8d6a6858d58f0687f31ea62b69399e04
2022-11-16 14:06:48 +00:00
J-Alves
c8e49504dd docs(spm): s-el0 partition support update
S-EL0 partitions already support indirect messaging and notifications
so add that to supported features.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I08e04593653ba38a2b82395f6f2d3ca7b212d494
2022-11-15 11:03:50 +00:00
Olivier Deprez
f41e23ea73 Merge changes from topic "mp/ras_refactoring" into integration
* changes:
  docs: document do_panic() and panic() helper functions
  fix(ras): restrict RAS support for NS world
2022-11-10 17:46:21 +01:00
Shruti Gupta
99d9ce8a68 docs(rme): add instruction to build rmm
Add documentation to build and run TF-A with RMM,
Linux kernel and TFTF Realm Payload.

Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
Change-Id: I951b41a144aabe0fec16eb933d7f005a65f06fb2
2022-11-09 09:55:41 +00:00
Manish Pandey
46cc41d559 fix(ras): restrict RAS support for NS world
Current RAS framework in TF-A only supports handling errors originating
from NS world but the HANDLE_EA_EL3_FIRST flag configures it for all
lower Els. To make the current design of RAS explicit, rename this macro
to HANDLE_EA_EL3_FIRST_NS and set EA bit in scr_el3 only when
switching to NS world.

Note: I am unaware of any platform which traps errors originating in
Secure world to EL3, if there is any such platform then it need to
be explicitly implemented in TF-A

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: If58eb201d8fa792c16325c85c26056e9b409b750
2022-11-08 10:10:59 +00:00
Madhukar Pappireddy
10b292e649 docs(spm): update FF-A manifest binding
Added action in response to Non-secure interrupt attribute to the
partition manifest.

Change-Id: I1d4f85e58b2f1fea7230dffc6a4361f7fd65be15
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2022-11-02 15:53:24 -05:00
Olivier Deprez
77a53b8fe4 Merge changes from topic "ffa_el3_spmc" into integration
* changes:
  docs(spm): add threat model for el3 spmc
  docs(spm): add design documentation
2022-10-28 10:22:39 +02:00
Shruti Gupta
4090ac33f4 docs(spm): add design documentation
Add documentation how to build EL3 SPMC,
briefly describes all FF-A interfaces,
SP boot flow, SP Manifest, Power Management,
Boot Info Protocol, Runtime model and state
transition and Interrupt Handling.

Signed-off-by: Shruti Gupta <shruti.gupta@arm.com>
Change-Id: I630df1d50a4621b344a09e462563eacc90109de4
2022-10-27 11:39:53 +01:00
Manish Pandey
2c16b802cb Merge "fix(ras): trap "RAS error record" accesses only for NS" into integration 2022-09-30 14:14:26 +02:00
Manish V Badarkhe
ea7aee20c1 Merge "fix(rmmd): return X4 output value" into integration 2022-09-29 10:25:57 +02:00
Manish Pandey
00e8f79c15 fix(ras): trap "RAS error record" accesses only for NS
RAS_TRAP_LOWER_EL_ERR_ACCESS was used to prevent access to RAS error
record registers (RAS ERR* & RAS ERX*) from lower EL's in any security
state. To give more fine grain control per world basis re-purpose this
macro to RAS_TRAP_NS_ERR_REC_ACCESS, which will enable the trap only
if Error record registers are accessed from NS.
This will also help in future scenarios when RAS handling(in Firmware
first handling paradigm)can be offloaded to a secure partition.

This is first patch in series to refactor RAS framework in TF-A.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ifa7f60bc8c82c9960adf029001bc36c443016d5d
2022-09-28 17:10:57 +01:00
AlexeiFedorov
8e51cccaef fix(rmmd): return X4 output value
Return values contained in 'smc_result' structure
are shifted down by one register:
X1 written by RMM is returned to NS in X0 and
X5 is returned in X4.

Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: I92907ac3ff3bac8554643ae7c198a4a758c38cb3
2022-09-28 15:11:03 +02:00
Sandrine Bailleux
d8d0ea9a7f Merge "docs(fwu): update firmware update design" into integration 2022-09-26 11:02:51 +02:00
Manish V Badarkhe
eb3d4015a3 docs(fwu): update firmware update design
Refactored legacy firmware design and added details about PSA
firmware updates.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: I9c123b3f62580d4271dbaff0a728b6412fae7890
2022-09-16 09:12:00 +01:00
Florian Lugou
b0980e5843 feat(services): add a SPD for ProvenCore
Adds a dispatcher for ProvenCore based on the test secure payload
dispatcher.

Signed-off-by: Florian Lugou <florian.lugou@provenrun.com>
Change-Id: I978afc3af6a6f65791655685a7bc80070673c9f3
2022-09-15 22:26:57 +02:00
Javier Almansa Sobrino
e50fedbc86 fix(doc): document missing RMM-EL3 runtime services
This patch adds documentation for the missing RMM-EL3
runtime services:

* RMM_RMI_REQ_COMPLETE
* RMM_GTSI_DELEGATE
* RMM_GTSI_UNDELEGATE

This patch also fixes a couple of minor bugs on return codes
for delegate/undelegate internal APIs.

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: Ic721005e7851e838eebaee7865ba78fadc3309e4
2022-07-21 12:36:45 +01:00
Javier Almansa Sobrino
6944729086 docs(rmmd): document EL3-RMM Interfaces
This patch documents the RMM-EL3 Boot and runtime interfaces.

Note that for the runtime interfaces, some services are not
documented in this patch and will be added on a later doc patch.

These services are:

* RMMD_GTSI_DELEGATE
* RMMD_GTSI_UNDELEGATE
* RMMD_RMI_REQ_COMPLETE

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: I8fcc89d91fe5a334c2f68c6bfd1fd672a8738b5c
2022-07-05 10:41:18 +02:00
Olivier Deprez
9eea92a1f2 docs(spm): refresh FF-A SPM design doc
- Move manifest binding doc as a dedicated SPM doc section.
- Highlight introduction of an EL3 FF-A SPM solution.
- Refresh TF-A build options.
- Refresh PE MMU configuration section.
- Add arch extensions for security hardening section.
- Minor corrections, typos fixes and rephrasing.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I2db06c140ef5871a812ce00a4398c663d5433bb4
2022-06-01 13:27:17 +02:00
Olivier Deprez
79a913812f docs(spm): update FF-A manifest binding
- Add security state attribute to memory and device regions.
- Rename device region reg attribution to base-address aligned with
  memory regions.
- Add pages-count field to device regions.
- Refresh interrupt attributes description in device regions.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I901f48d410edb8b10f65bb35398b80f18105e427
2022-06-01 10:58:32 +02:00
J-Alves
573ac37373 docs(spm): update ff-a boot protocol documentation
Updated following sections to document implementation of the FF-A boot
information protocol:
- Describing secure partitions.
- Secure Partition Packages.
- Passing boot data to the SP.
Also updated description of the manifest field 'gp-register-num'.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I5c856437b60cdf05566dd636a01207c9b9f42e61
2022-05-25 16:58:28 +01:00
Marc Bonnici
59bd2ad83c feat(spmc): add support for FF-A power mgmt. messages in the EL3 SPMC
This patch adds support for forwarding the following PSCI messages
received by the SPMC at EL3 to the S-EL1 SP if the SP has indicated
that it wishes to receive the appropriate message via its manifest.

1. A PSCI CPU_OFF message in response to a cpu hot unplug request
   from the OS.
2. A message to indicate warm boot of a cpu in response to a cpu
   hot plug request from the OS.
3. A PSCI CPU_SUSPEND message in response to a cpu idle event
   initiated from the OS.
4. A message to indicate warm boot of a cpu from a shallow power
   state in response to a cpu resume power event.

This patch also implements the FFA_SECONDARY_EP_REGISTER function to
enable the SP specify its secondary entrypoint.

Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: I375d0655b2c6fc27445facc39213d1d0678557f4
2022-05-13 15:51:23 +01:00