Commit Graph

88 Commits

Author SHA1 Message Date
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
Manish V Badarkhe b80e751d99 docs(fconf): update device tree binding for FCONF
Added a description for the newly introduced 'ns-load-address' property
in the dtb-registry node of FCONF.

Change-Id: Ief8e8a55a6363fd42b23491d000b097b0c48453b
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2022-04-28 07:09:53 +01:00
Sandrine Bailleux 94909893df Merge "docs: fix mailing lists URLs" into integration 2022-04-25 07:58:46 +02:00
Sandrine Bailleux f4a55e6b32 docs: fix mailing lists URLs
With the transition to mailman3, the URLs of TF-A and TF-A Tests
mailing lists have changed. However, we still refer to the old
location, which are now dead links.

Update all relevant links throughout the documentation.

There is one link referring to a specific thread on the TF-A mailing
list in the SPM documentation, for which I had to make a guess as to
what's the equivalent mailman3 URL. The old URL scheme indicates that
the thread dates from February 2020 but beyond that, I could not make
sense of the thread id within the old URL so I picked the most likely
match amongst the 3 emails posted on the subject in this time period.

Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Reported-by: Kuohong Wang <kuohong.wang@mediatek.com>
Change-Id: I83f4843afd1dd46f885df225931d8458152dbb58
2022-04-21 10:26:23 +02:00
Marc Bonnici 1d63ae4d0d feat(spmc): enable building of the SPMC at EL3
Introduce build flag for enabling the secure partition
manager core, SPMC_AT_EL3. When enabled, the SPMC module
will be included into the BL31 image. By default the
flag is disabled.

Signed-off-by: Marc Bonnici <marc.bonnici@arm.com>
Change-Id: I5ea1b953e5880a07ffc91c4dea876a375850cf2a
2022-04-13 09:44:49 +01:00
Joanna Farley e638c228b8 Merge "build(sptool): handle uuid field in SP layout file" into integration 2022-03-23 14:31:31 +01:00
Manish Pandey 1dd4bafb82 docs(rme): minor update to 4 world execution instructions
Following updates done
  - Clarification on building Hafnium
  - New test suite "Invalid memory access"

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I04a934a648d53a860f06cd6cf3776ee534675bd9
2022-03-02 14:07:39 +00:00
Imre Kis 5ac60ea15e build(sptool): handle uuid field in SP layout file
Extract the UUID from the SP layout JSON file if the optional 'uuid'
field exists otherwise fall back to the current method for extracting
the SP UUID from the partition manifest file.

This change gives a way to decouple TF-A's dependency on the SP
manifest file's format which is tied to the SPMC.

Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: I13af066c1de58bfb9c3fd470ee137ea0275cd98c
2022-02-10 11:37:50 +01:00
J-Alves c1ff1791f7 docs(ff-a): boot order field of SPs manifest
Document `boot-order` field from FF-A partitions manifest, in accordance
to Hafnium's (SPM) implementation.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I9fd070100ee52e0d465d2cce830cc91d78bddfc0
2021-12-16 09:24:56 +00:00
Olivier Deprez f92b00187a Merge "docs(ff-a): update documentation of FF-A interfaces" into integration 2021-11-22 18:38:07 +01:00
J-Alves 16c1c45326 docs(ff-a): update documentation of FF-A interfaces
- Overview of FF-A v1.1 notifications feature, and list of all
the new related interface.
- FFA_RXTX_UNMAP now implemented, so provided description.
- FF-A v1.1 interfaces documented: FFA_SPM_ID_GET and
FFA_SECONDARY_EP_REGISTER.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: If40b4d2b2473f81ecfb2ddbf14852c3f10682867
2021-11-18 14:41:28 +00:00
Olivier Deprez 095342d3e4 Merge "docs(spm): document s-el0 partition support" into integration 2021-11-17 13:54:04 +01:00
Manish Pandey d5c70fa9f9 Merge "fix(spm_mm): do not compile if SVE/SME is enabled" into integration 2021-11-16 23:30:55 +01:00
Manish Pandey 4333f95bed fix(spm_mm): do not compile if SVE/SME is enabled
As spm_mm cannot handle SVE/SME usage in NS world so its better to give
compilation error when ENABLE_SVE_FOR_NS=1 or ENABLE_SME_FOR_NS=1.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I69dbb272ca681bb020501342008eda20d4c0b096
2021-11-16 16:06:33 +00:00
Zelalem Aweke 7446c266c9 docs(rme): add description of TF-A changes for RME
This patch expands the RME documentation with description of TF-A
changes for RME. It also modifies some other parts of TF-A documentation
to account for RME changes.

Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com>
Change-Id: I9e6feeee235f0ba4b767d239f15840f1e0c540bb
2021-11-15 22:20:07 +01:00
johpow01 6ee92598cf docs(gpt): add documentation page for GPT library
This patch adds some documentation for the GPT library as well as adds
code owners for it.

Signed-off-by: John Powell <john.powell@arm.com>
Change-Id: If1cd79626eadb27e1024d731b26ee2e20af74a66
2021-11-15 23:17:04 +02:00
Madhukar Pappireddy 52558e080d docs(spm): secure interrupt management in SPMC
Change-Id: I9bed67e4146ae92123ab925334e37fb0d3677ef1
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2021-11-10 16:07:33 -06:00
Raghu Krishnamurthy aeea04d44d docs(spm): document s-el0 partition support
This patch adds a brief description of S-EL0 partition support in the
SPMC using ARMv8.1 FEAT_VHE.

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: Ie079265476604f62d5f2a66684f01341000969d0
2021-11-05 14:32:44 -07:00
Chris Kay 68120783d6 feat(mpmm): add support for MPMM
MPMM - the Maximum Power Mitigation Mechanism - is an optional
microarchitectural feature present on some Armv9-A cores, introduced
with the Cortex-X2, Cortex-A710 and Cortex-A510 cores.

MPMM allows the SoC firmware to detect and limit high activity events
to assist in SoC processor power domain dynamic power budgeting and
limit the triggering of whole-rail (i.e. clock chopping) responses to
overcurrent conditions.

This feature is enabled via the `ENABLE_MPMM` build option.
Configuration can be done via FCONF by enabling `ENABLE_MPMM_FCONF`, or
by via the plaform-implemented `plat_mpmm_topology` function.

Change-Id: I77da82808ad4744ece8263f0bf215c5a091c3167
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-10-26 12:15:42 +01:00
Chris Kay 742ca2307f feat(amu): enable per-core AMU auxiliary counters
This change makes AMU auxiliary counters configurable on a per-core
basis, controlled by `ENABLE_AMU_AUXILIARY_COUNTERS`.

Auxiliary counters can be described via the `HW_CONFIG` device tree if
the `ENABLE_AMU_FCONF` build option is enabled, or the platform must
otherwise implement the `plat_amu_topology` function.

A new phandle property for `cpu` nodes (`amu`) has been introduced to
the `HW_CONFIG` specification to allow CPUs to describe the view of
their own AMU:

```
cpu0: cpu@0 {
    ...

    amu = <&cpu0_amu>;
};
```

Multiple cores may share an `amu` handle if they implement the
same set of auxiliary counters.

AMU counters are described for one or more AMUs through the use of a new
`amus` node:

```
amus {
    cpu0_amu: amu-0 {
        #address-cells = <1>;
        #size-cells = <0>;

        counter@0 {
            reg = <0>;

            enable-at-el3;
        };

        counter@n {
            reg = <n>;

            ...
        };
    };
};
```

This structure describes the **auxiliary** (group 1) AMU counters.
Architected counters have architecturally-defined behaviour, and as
such do not require DTB entries.

These `counter` nodes support two properties:

- The `reg` property represents the counter register index.
- The presence of the `enable-at-el3` property determines whether
  the firmware should enable the counter prior to exiting EL3.

Change-Id: Ie43aee010518c5725a3b338a4899b0857caf4c28
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-10-26 12:15:33 +01:00
Chris Kay 9cf7564723 docs(amu): add AMU documentation
This change adds some documentation on the AMU and its purpose. This is
expanded on in later patches.

Change-Id: If2834676790938d8da5ea2ceba37b674f6cc0f01
Signed-off-by: Chris Kay <chris.kay@arm.com>
2021-10-26 12:14:34 +01:00
Manish V Badarkhe e742bcdae0 feat(measured_boot): update tb_fw_config with event log properties
Making tb_fw_config ready to pass the Event Log base address
and size information to BL2.

Change-Id: I5dd0e79007e3848b5d6d0e69275a46c2e9807a98
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-10-12 17:53:48 +01:00
Zelalem Aweke 3cfa3497ba docs(rme): add build and run instructions for FEAT_RME
This patch adds instructions on how to build and run TF-A
with FEAT_RME enabled. The patch also adds code owners for
FEAT_RME.

Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com>
Change-Id: Id16dc52cb76b1ea56ac5c3fc38cb0794a62ac2a1
2021-10-05 11:56:00 -05:00
Gary Morrison 5fb061e761 chore: fvp_r: Initial No-EL3 and MPU Implementation
For v8-R64, especially R82, creating code to run BL1 at EL2, using MPU.

Signed-off-by: Gary Morrison <gary.morrison@arm.com>
Change-Id: I439ac3915b982ad1e61d24365bdd1584b3070425
2021-09-30 17:05:59 +01:00
Olivier Deprez 2245bb8a77 Merge "refactor(spmd): boot interface and pass core id" into integration 2021-09-24 08:47:40 +02:00
Manish Pandey e693013b4e Merge "docs(ff-a): fix specification naming" into integration 2021-09-15 11:40:43 +02:00
Olivier Deprez f2dcf41826 refactor(spmd): boot interface and pass core id
This change refactors the SPMD to setup SPMC CPU contexts once and early
from spmd_spmc_init (single call to cm_setup_context rather than on each
and every warm boot).
Pass the core linear ID through a GP register as an implementation
defined behavior helping FF-A adoption to legacy TOSes (essentially
when secure virtualization is not used).

A first version of this change was originally submitted by Lukas [1].
Pasting below the original justification:

Our TEE, Kinibi, is used to receive the core linear ID in the x3
register of booting secondary cores.
This patch is necessary to bring up secondary cores with Kinibi as an
SPMC in SEL1.

In Kinibi, the TEE is mostly platform-independent and all platform-
specifics like topology is concentrated in TF-A of our customers.
That is why we don't have the MPIDR - linear ID mapping in Kinibi.
We need the correct linear ID to program the GICv2 target register,
for example in power management case.
It is not needed on GICv3/v4, because of using a fixed mapping from
MPIDR to ICDIPTR/GICD_ITARGETSRn register.

For debug and power management purpose, we also want a unified view to
linear id between Linux and the TEE.
E.g. to disable a core, to see what cores are printing a trace /
an event.

In the past, Kinibi had several other designs, but the complexity was
getting out of control:
* Platform-specific assembler macros in the kernel.
* A per-core SMC from Linux to tell the linear ID after the boot.
* With DynamiQ, it seems SIPs were playing with MPIDR register values,
  reusing them between cores and changing them during boot.

[1] https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/10235

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Signed-off-by: Lukas Hanel <lukas.hanel@trustonic.com>
Change-Id: Ifa8fa208e9b8eb1642c80b5f7b54152dadafa75e
2021-09-09 16:51:17 +02:00
Olivier Deprez 8a5bd3cfed docs(ff-a): fix specification naming
Rename the FF-A specification to:
Arm Firmware Framework for Arm A-profile

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I4f9d29409d048e7a49832b95d39d2583c1fb5792
2021-09-06 18:42:24 +02:00
Maksims Svecovs 12349d3332 docs(ff-a): managed exit parameter separation
As of DEN0077A FF-A v1.1 Beta0 section 5.2, managed exit
support is moved out of messaging-method field and is described in a
separate field.

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: Icb12d9dc0d10b11c105dc1920e5212b0359af147
2021-08-23 15:46:46 +01:00
Maksims Svecovs bb320dbc47 feat(ff-a): change manifest messaging method
Align documentation with changes of messaging method for partition
manifest:
      - Bit[0]: support for receiving direct message requests
      - Bit[1]: support for sending direct messages
      - Bit[2]: support for indirect messaging
      - Bit[3]: support for managed exit
Change the optee_sp_manifest to align with the new messaging method
description.

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: I333e82c546c03698c95f0c77293018f8dca5ba9c
2021-07-22 14:21:41 +01:00
Olivier Deprez b5dd2422a0 docs: spm design document refresh
General refresh of the SPM document.

Change-Id: I2f8e37c3f34bc8511b115f00b9a53b6a6ff41bea
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
2021-05-12 15:45:27 +02:00
Olivier Deprez 1b17f4f1f8 docs: remove PSA wording for SPM chapters
PSA wording is not longer associated with FF-A.

Change-Id: Id7c53b9c6c8f383543f6a32a15eb15b7749d8658
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
2021-04-30 08:44:26 +02:00
Mark Dykes 1d1e500648 Merge "Add documentation for SMMUv3 driver in Hafnium(SPM)" into integration 2021-04-21 19:09:41 +02:00
Manish Pandey 2480e4c3e7 doc: spm: update messaging method field
As per FF-A v1.0 spec, Table 3.1, messaging method field also contains
information about whether partition supports managed exit or not.
Since a partition can support managed exit only if it supports direct
messaging, so there are two new possible values, managed exit with only
direct messaging or with both messaging methods.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: Ic77cfb37d70975c3a36c56f8b7348d385735f378
2021-04-20 21:24:44 +02:00
Madhukar Pappireddy 4ec3ccb459 Add documentation for SMMUv3 driver in Hafnium(SPM)
Change-Id: I0b38c114fd2958d2b4040585611cafa132ccfd9c
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2021-04-19 14:25:51 -05:00
David Horstmann 5d9101b39c Fix typos and misspellings
Fix a number of typos and misspellings in TF-A
documentation and comments.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
Change-Id: I34c5a28c3af15f28d1ccada4d9866aee6af136ee
2020-11-12 15:21:11 +00:00
Manish Pandey 0901d3398d doc: add description of "owner" field in SP layout file.
Change-Id: Iedaa83ed546eb2476849a8d53f6e05b847a48b23
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
2020-09-15 09:45:15 +00:00
Manish V Badarkhe e87c823102 doc: Update the cot-binding for nv-counter node
Updated the cot-binding documentation to add 'id'
property for the trusted and non-trusted nv-counters.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: If1c628c5b90fe403dd96c7cd0cd04f37288c965c
2020-08-28 09:50:03 +00:00
Madhukar Pappireddy a4075bb55b Fix broken links in docs
Change-Id: If82aaba9f2a5a74cfb5e4381f968166037a70037
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2020-08-06 12:36:17 -05:00
Madhukar Pappireddy 6844c3477b Fix broken links to various sections across docs
These broken links were found with the help of this command:
$> sphinx-build -M linkcheck . build

A sample broken link is reported as follows:
(line   80) -local-   firmware-design.rst#secure-el1-payloads-and-dispatchers

Change-Id: I5dcefdd4b8040908658115647e957f6c2c5da7c2
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
2020-08-03 09:55:04 -05:00
joanna.farley 833abc61a4 Merge "doc: secure partition manager design" into integration 2020-07-29 10:34:09 +00:00
Alexei Fedorov 4a135bc33e plat/arm/board/fvp: Add support for Measured Boot
This patch adds support for Measured Boot functionality
to FVP platform code. It also defines new properties
in 'tpm_event_log' node to store Event Log address and
it size
'tpm_event_log_sm_addr'
'tpm_event_log_addr'
'tpm_event_log_size'
in 'event_log.dtsi' included in 'fvp_tsp_fw_config.dts'
and 'fvp_nt_fw_config.dts'. The node and its properties
are described in binding document
'docs\components\measured_boot\event_log.rst'.

Change-Id: I087e1423afcb269d6cfe79c1af9c348931991292
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
2020-07-22 10:31:23 +00:00
Olivier Deprez fcb1398ff1 doc: secure partition manager design
Former EL3 Secure Partition Manager using MM protocol is renamed
Secure Partition Manager (MM).
A new Secure Partition Manager document covers TF-A support for the
PSA FF-A compliant implementation.

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I9763359c2e96181e1726c8ad72738de293b80eb4
2020-07-21 17:36:42 +02:00
Manish V Badarkhe b5fb69173b doc: Update CoT binding to make it more generic
Updated the CoT binding document to show chain of trust relationship
with the help of 'authentication method' and 'authentication data'
instead of showing content of certificate and fixed rendering issue
while creating html page using this document.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: Ib48279cfe786d149ab69ddc711caa381a50f9e2b
2020-07-09 11:26:39 +01:00
Manish Pandey c3233c11c4 doc: RAS: fixing broken links
There were some links in the file "ras.rst" which were broken, this
patch fixes all the broken links in this file.

Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I00cf080e9338af5786239a4843cb4c2e0cc9d99d
2020-06-30 22:45:01 +01:00
Manish V Badarkhe e555787b66 doc: Update BL1 and BL2 boot flow
Updated the document for BL1 and BL2 boot flow to capture
below changes made in FCONF

1. Loading of fw_config and tb_fw_config images by BL1.
2. Population of fw_config and tb_fw_config by BL2.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: Ifea5c61d520ff1de834c279ce1759b53448303ba
2020-06-26 07:26:09 +00:00
Manish V Badarkhe ebd34bea0b doc: Add a binding document for COT descriptors
Added a binding document for COT descriptors which is going
to be used in order to create COT desciptors at run-time.

Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
Change-Id: Ic54519b0e16d145cd1609274a00b137a9194e8dd
2020-06-23 15:52:54 +01:00