xref: /rk3399_ARM-atf/docs/components/secure-partition-manager.rst (revision 4ec3ccb4599d7dded9757701a82aea712b791cb0)
1fcb1398fSOlivier DeprezSecure Partition Manager
2fcb1398fSOlivier Deprez************************
3fcb1398fSOlivier Deprez
4fcb1398fSOlivier Deprez.. contents::
5fcb1398fSOlivier Deprez
6fcb1398fSOlivier DeprezAcronyms
7fcb1398fSOlivier Deprez========
8fcb1398fSOlivier Deprez
9fcb1398fSOlivier Deprez+--------+-----------------------------------+
10*4ec3ccb4SMadhukar Pappireddy| DMA    | Direct Memory Access              |
11*4ec3ccb4SMadhukar Pappireddy+--------+-----------------------------------+
12fcb1398fSOlivier Deprez| DTB    | Device Tree Blob                  |
13fcb1398fSOlivier Deprez+--------+-----------------------------------+
14fcb1398fSOlivier Deprez| DTS    | Device Tree Source                |
15fcb1398fSOlivier Deprez+--------+-----------------------------------+
16fcb1398fSOlivier Deprez| EC     | Execution Context                 |
17fcb1398fSOlivier Deprez+--------+-----------------------------------+
18fcb1398fSOlivier Deprez| FIP    | Firmware Image Package            |
19fcb1398fSOlivier Deprez+--------+-----------------------------------+
20fcb1398fSOlivier Deprez| FF-A   | Firmware Framework for A-class    |
21fcb1398fSOlivier Deprez+--------+-----------------------------------+
22fcb1398fSOlivier Deprez| IPA    | Intermediate Physical Address     |
23fcb1398fSOlivier Deprez+--------+-----------------------------------+
24fcb1398fSOlivier Deprez| NWd    | Normal World                      |
25fcb1398fSOlivier Deprez+--------+-----------------------------------+
26fcb1398fSOlivier Deprez| ODM    | Original Design Manufacturer      |
27fcb1398fSOlivier Deprez+--------+-----------------------------------+
28fcb1398fSOlivier Deprez| OEM    | Original Equipment Manufacturer   |
29fcb1398fSOlivier Deprez+--------+-----------------------------------+
30fcb1398fSOlivier Deprez| PA     | Physical Address                  |
31fcb1398fSOlivier Deprez+--------+-----------------------------------+
32fcb1398fSOlivier Deprez| PE     | Processing Element                |
33fcb1398fSOlivier Deprez+--------+-----------------------------------+
34fcb1398fSOlivier Deprez| PVM    | Primary VM                        |
35fcb1398fSOlivier Deprez+--------+-----------------------------------+
36fcb1398fSOlivier Deprez| PSA    | Platform Security Architecture    |
37fcb1398fSOlivier Deprez+--------+-----------------------------------+
38*4ec3ccb4SMadhukar Pappireddy| SMMU   | System Memory Management Unit     |
39*4ec3ccb4SMadhukar Pappireddy+--------+-----------------------------------+
40fcb1398fSOlivier Deprez| SP     | Secure Partition                  |
41fcb1398fSOlivier Deprez+--------+-----------------------------------+
42fcb1398fSOlivier Deprez| SPM    | Secure Partition Manager          |
43fcb1398fSOlivier Deprez+--------+-----------------------------------+
44fcb1398fSOlivier Deprez| SPMC   | SPM Core                          |
45fcb1398fSOlivier Deprez+--------+-----------------------------------+
46fcb1398fSOlivier Deprez| SPMD   | SPM Dispatcher                    |
47fcb1398fSOlivier Deprez+--------+-----------------------------------+
48fcb1398fSOlivier Deprez| SiP    | Silicon Provider                  |
49fcb1398fSOlivier Deprez+--------+-----------------------------------+
50fcb1398fSOlivier Deprez| SWd    | Secure World                      |
51fcb1398fSOlivier Deprez+--------+-----------------------------------+
52fcb1398fSOlivier Deprez| TLV    | Tag-Length-Value                  |
53fcb1398fSOlivier Deprez+--------+-----------------------------------+
54fcb1398fSOlivier Deprez| TOS    | Trusted Operating System          |
55fcb1398fSOlivier Deprez+--------+-----------------------------------+
56fcb1398fSOlivier Deprez| VM     | Virtual Machine                   |
57fcb1398fSOlivier Deprez+--------+-----------------------------------+
58fcb1398fSOlivier Deprez
59fcb1398fSOlivier DeprezForeword
60fcb1398fSOlivier Deprez========
61fcb1398fSOlivier Deprez
62fcb1398fSOlivier DeprezTwo implementations of a Secure Partition Manager co-exist in the TF-A codebase:
63fcb1398fSOlivier Deprez
64fcb1398fSOlivier Deprez-  SPM based on the PSA FF-A specification `[1]`_.
65fcb1398fSOlivier Deprez-  SPM based on the MM interface to communicate with an S-EL0 partition `[2]`_.
66fcb1398fSOlivier Deprez
67fcb1398fSOlivier DeprezBoth implementations differ in their architectures and only one can be selected
68fcb1398fSOlivier Deprezat build time.
69fcb1398fSOlivier Deprez
70fcb1398fSOlivier DeprezThis document:
71fcb1398fSOlivier Deprez
72fcb1398fSOlivier Deprez-  describes the PSA FF-A implementation where the Secure Partition Manager
73fcb1398fSOlivier Deprez   resides at EL3 and S-EL2 (or EL3 and S-EL1).
74fcb1398fSOlivier Deprez-  is not an architecture specification and it might provide assumptions
75fcb1398fSOlivier Deprez   on sections mandated as implementation-defined in the specification.
76fcb1398fSOlivier Deprez-  covers the implications to TF-A used as a bootloader, and Hafnium
77fcb1398fSOlivier Deprez   used as a reference code base for an S-EL2 secure firmware on
78fcb1398fSOlivier Deprez   platforms implementing Armv8.4-SecEL2.
79fcb1398fSOlivier Deprez
80fcb1398fSOlivier DeprezTerminology
81fcb1398fSOlivier Deprez-----------
82fcb1398fSOlivier Deprez
83fcb1398fSOlivier Deprez-  Hypervisor refers to the NS-EL2 component managing Virtual Machines (or
84fcb1398fSOlivier Deprez   partitions) in the Normal World.
85fcb1398fSOlivier Deprez-  SPMC refers to the S-EL2 component managing Virtual Machines (or Secure
86fcb1398fSOlivier Deprez   Partitions) in the Secure World when Armv8.4-SecEL2 extension is implemented.
87fcb1398fSOlivier Deprez-  Alternatively, SPMC can refer to an S-EL1 component, itself being a Secure
88fcb1398fSOlivier Deprez   Partition and implementing the FF-A ABI on pre-Armv8.4 platforms.
89fcb1398fSOlivier Deprez-  VM refers to a Normal World Virtual Machine managed by an Hypervisor.
90fcb1398fSOlivier Deprez-  SP refers to a Secure World "Virtual Machine" managed by the SPMC component.
91fcb1398fSOlivier Deprez
92fcb1398fSOlivier DeprezSupport for legacy platforms
93fcb1398fSOlivier Deprez----------------------------
94fcb1398fSOlivier Deprez
95fcb1398fSOlivier DeprezIn the implementation, the SPM is split into SPMD and SPMC components
96fcb1398fSOlivier Deprez(although not strictly mandated by the specification). SPMD is located
97fcb1398fSOlivier Deprezat EL3 and principally relays FF-A messages from NWd (Hypervisor or OS
98fcb1398fSOlivier Deprezkernel) to SPMC located either at S-EL1 or S-EL2.
99fcb1398fSOlivier Deprez
100fcb1398fSOlivier DeprezHence TF-A must support both cases where SPMC is either located at:
101fcb1398fSOlivier Deprez
102fcb1398fSOlivier Deprez-  S-EL1 supporting pre-Armv8.4 platforms. SPMD conveys FF-A protocol
103fcb1398fSOlivier Deprez   from EL3 to S-EL1.
104fcb1398fSOlivier Deprez-  S-EL2 supporting platforms implementing Armv8.4-SecEL2 extension.
105fcb1398fSOlivier Deprez   SPMD conveys FF-A protocol from EL3 to S-EL2.
106fcb1398fSOlivier Deprez
107fcb1398fSOlivier DeprezThe same SPMD component is used to support both configurations. The SPMC
108fcb1398fSOlivier Deprezexecution level is a build time choice.
109fcb1398fSOlivier Deprez
110fcb1398fSOlivier DeprezSample reference stack
111fcb1398fSOlivier Deprez======================
112fcb1398fSOlivier Deprez
113fcb1398fSOlivier DeprezThe following diagram illustrates a possible configuration with SPMD and SPMC,
114fcb1398fSOlivier Deprezone or multiple Secure Partitions, with or without an optional Hypervisor:
115fcb1398fSOlivier Deprez
116fcb1398fSOlivier Deprez.. image:: ../resources/diagrams/ff-a-spm-sel2.png
117fcb1398fSOlivier Deprez
118fcb1398fSOlivier DeprezTF-A build options
119fcb1398fSOlivier Deprez==================
120fcb1398fSOlivier Deprez
121fcb1398fSOlivier DeprezThe following TF-A build options are provisioned:
122fcb1398fSOlivier Deprez
123fcb1398fSOlivier Deprez-  **SPD=spmd**: this option selects the SPMD component to relay FF-A
124fcb1398fSOlivier Deprez   protocol from NWd to SWd back and forth. It is not possible to
125fcb1398fSOlivier Deprez   enable another Secure Payload Dispatcher when this option is chosen.
126fcb1398fSOlivier Deprez-  **SPMD_SPM_AT_SEL2**: this option adjusts the SPMC execution
127fcb1398fSOlivier Deprez   level to being S-EL1 or S-EL2. It defaults to enabled (value 1) when
128fcb1398fSOlivier Deprez   SPD=spmd is chosen.
129fcb1398fSOlivier Deprez-  **CTX_INCLUDE_EL2_REGS**: this option permits saving (resp.
130fcb1398fSOlivier Deprez   restoring) the EL2 system register context before entering (resp.
131fcb1398fSOlivier Deprez   after leaving) the SPMC. It is mandatory when ``SPMD_SPM_AT_SEL2`` is
132fcb1398fSOlivier Deprez   enabled. The context save/restore routine and exhaustive list of
133a4075bb5SMadhukar Pappireddy   registers is visible at `[4]`_.
134fcb1398fSOlivier Deprez-  **SP_LAYOUT_FILE**: this option provides a text description file
135fcb1398fSOlivier Deprez   providing paths to SP binary images and DTS format manifests
136fcb1398fSOlivier Deprez   (see `Specifying partition binary image and DT`_). It
137fcb1398fSOlivier Deprez   is required when ``SPMD_SPM_AT_SEL2`` is enabled hence when multiple
138fcb1398fSOlivier Deprez   secure partitions are to be loaded on behalf of SPMC.
139fcb1398fSOlivier Deprez
140fcb1398fSOlivier Deprez+------------------------------+----------------------+------------------+
141fcb1398fSOlivier Deprez|                              | CTX_INCLUDE_EL2_REGS | SPMD_SPM_AT_SEL2 |
142fcb1398fSOlivier Deprez+------------------------------+----------------------+------------------+
143fcb1398fSOlivier Deprez| SPMC at S-EL1 (e.g. OP-TEE)  |           0          |        0         |
144fcb1398fSOlivier Deprez+------------------------------+----------------------+------------------+
145fcb1398fSOlivier Deprez| SPMC at S-EL2 (e.g. Hafnium) |           1          | 1 (default when  |
146fcb1398fSOlivier Deprez|                              |                      |    SPD=spmd)     |
147fcb1398fSOlivier Deprez+------------------------------+----------------------+------------------+
148fcb1398fSOlivier Deprez
149fcb1398fSOlivier DeprezOther combinations of such build options either break the build or are not
150fcb1398fSOlivier Deprezsupported.
151fcb1398fSOlivier Deprez
152fcb1398fSOlivier DeprezNote, the ``CTX_INCLUDE_EL2_REGS`` option provides the generic support for
153fcb1398fSOlivier Deprezbarely saving/restoring EL2 registers from an Arm arch perspective. As such
154fcb1398fSOlivier Deprezit is decoupled from the ``SPD=spmd`` option.
155fcb1398fSOlivier Deprez
156fcb1398fSOlivier DeprezBL32 option is re-purposed to specify the SPMC image. It can specify either the
157fcb1398fSOlivier DeprezHafnium binary path (built for the secure world) or the path to a TEE binary
158fcb1398fSOlivier Deprezimplementing the FF-A protocol.
159fcb1398fSOlivier Deprez
160fcb1398fSOlivier DeprezBL33 option can specify either:
161fcb1398fSOlivier Deprez
162fcb1398fSOlivier Deprez-  the TFTF binary or
163fcb1398fSOlivier Deprez-  the Hafnium binary path (built for the normal world) if VMs were loaded by
164fcb1398fSOlivier Deprez   TF-A beforehand or
165fcb1398fSOlivier Deprez-  a minimal loader performing the loading of VMs and Hafnium.
166fcb1398fSOlivier Deprez
167fcb1398fSOlivier DeprezSample TF-A build command line when SPMC is located at S-EL1
168fcb1398fSOlivier Deprez(typically pre-Armv8.4):
169fcb1398fSOlivier Deprez
170fcb1398fSOlivier Deprez.. code:: shell
171fcb1398fSOlivier Deprez
172fcb1398fSOlivier Deprez    make \
173fcb1398fSOlivier Deprez    CROSS_COMPILE=aarch64-none-elf- \
174fcb1398fSOlivier Deprez    SPD=spmd \
175fcb1398fSOlivier Deprez    SPMD_SPM_AT_SEL2=0 \
176fcb1398fSOlivier Deprez    BL32=<path-to-tee-binary> \
177fcb1398fSOlivier Deprez    BL33=<path-to-nwd-binary> \
178fcb1398fSOlivier Deprez    PLAT=fvp \
179fcb1398fSOlivier Deprez    all fip
180fcb1398fSOlivier Deprez
181fcb1398fSOlivier DeprezSample TF-A build command line for an Armv8.4-SecEL2 enabled system
182fcb1398fSOlivier Deprezwhere SPMC is located at S-EL2:
183fcb1398fSOlivier Deprez
184fcb1398fSOlivier Deprez.. code:: shell
185fcb1398fSOlivier Deprez
186fcb1398fSOlivier Deprez    make \
187fcb1398fSOlivier Deprez    CROSS_COMPILE=aarch64-none-elf- \
188fcb1398fSOlivier Deprez    SPD=spmd \
189fcb1398fSOlivier Deprez    CTX_INCLUDE_EL2_REGS=1 \
190fcb1398fSOlivier Deprez    ARM_ARCH_MINOR=4 \
191fcb1398fSOlivier Deprez    BL32=<path-to-swd-hafnium-binary>
192fcb1398fSOlivier Deprez    BL33=<path-to-nwd-binary> \
193fcb1398fSOlivier Deprez    SP_LAYOUT_FILE=sp_layout.json \
194fcb1398fSOlivier Deprez    PLAT=fvp \
195fcb1398fSOlivier Deprez    all fip
196fcb1398fSOlivier Deprez
197fcb1398fSOlivier DeprezBuild options to enable secure boot:
198fcb1398fSOlivier Deprez
199fcb1398fSOlivier Deprez.. code:: shell
200fcb1398fSOlivier Deprez
201fcb1398fSOlivier Deprez    make \
202fcb1398fSOlivier Deprez    CROSS_COMPILE=aarch64-none-elf- \
203fcb1398fSOlivier Deprez    SPD=spmd \
204fcb1398fSOlivier Deprez    CTX_INCLUDE_EL2_REGS=1 \
205fcb1398fSOlivier Deprez    ARM_ARCH_MINOR=4 \
206fcb1398fSOlivier Deprez    BL32=<path-to-swd-hafnium-binary>
207fcb1398fSOlivier Deprez    BL33=<path-to-nwd-binary> \
208fcb1398fSOlivier Deprez    SP_LAYOUT_FILE=../tf-a-tests/build/fvp/debug/sp_layout.json \
209fcb1398fSOlivier Deprez    MBEDTLS_DIR=<path-to-mbedtls-lib> \
210fcb1398fSOlivier Deprez    TRUSTED_BOARD_BOOT=1 \
211fcb1398fSOlivier Deprez    COT=dualroot \
212fcb1398fSOlivier Deprez    ARM_ROTPK_LOCATION=devel_rsa \
213fcb1398fSOlivier Deprez    ROT_KEY=plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem \
214fcb1398fSOlivier Deprez    GENERATE_COT=1 \
215fcb1398fSOlivier Deprez    PLAT=fvp \
216fcb1398fSOlivier Deprez    all fip
217fcb1398fSOlivier Deprez
218fcb1398fSOlivier DeprezBoot process
219fcb1398fSOlivier Deprez============
220fcb1398fSOlivier Deprez
221fcb1398fSOlivier DeprezLoading Hafnium and Secure Partitions in the secure world
222fcb1398fSOlivier Deprez---------------------------------------------------------
223fcb1398fSOlivier Deprez
224fcb1398fSOlivier DeprezThe Hafnium implementation in normal world requires VMs to be loaded in
225fcb1398fSOlivier Deprezmemory prior to booting. The mechanism upon which VMs are loaded and
226fcb1398fSOlivier Deprezexposed to Hafnium are either:
227fcb1398fSOlivier Deprez
228fcb1398fSOlivier Deprez-  by supplying a ramdisk image where VM images are concatenated (1)
229fcb1398fSOlivier Deprez-  or by providing VM load addresses within Hafnium manifest (2)
230fcb1398fSOlivier Deprez
231fcb1398fSOlivier DeprezTF-A is the bootlader for the Hafnium and SPs in the secure world. TF-A
232fcb1398fSOlivier Deprezdoes not provide tooling or libraries manipulating ramdisks as required
233fcb1398fSOlivier Deprezby (1). Thus BL2 loads SPs payloads independently.
234fcb1398fSOlivier DeprezSPs may be signed by different parties (SiP, OEM/ODM, TOS vendor, etc.).
235fcb1398fSOlivier DeprezThus they are supplied as distinct “self-contained” signed entities within
236fcb1398fSOlivier Deprezthe FIP flash image. The FIP image itself is not signed hence providing
237fcb1398fSOlivier Deprezability to upgrade SPs in the field.
238fcb1398fSOlivier Deprez
239fcb1398fSOlivier DeprezBooting through TF-A
240fcb1398fSOlivier Deprez--------------------
241fcb1398fSOlivier Deprez
242fcb1398fSOlivier DeprezSP manifests
243fcb1398fSOlivier Deprez~~~~~~~~~~~~
244fcb1398fSOlivier Deprez
245fcb1398fSOlivier DeprezAn SP manifest describes SP attributes as defined in `[1]`_
246fcb1398fSOlivier Deprezsection 3.1 (partition manifest at virtual FF-A instance) in DTS text format. It
247fcb1398fSOlivier Deprezis represented as a single file associated with the SP. A sample is
248fcb1398fSOlivier Deprezprovided by `[5]`_. A binding document is provided by `[6]`_.
249fcb1398fSOlivier Deprez
250fcb1398fSOlivier DeprezSecure Partition packages
251fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~~~~~~~
252fcb1398fSOlivier Deprez
253fcb1398fSOlivier DeprezSecure Partitions are bundled as independent package files consisting
254fcb1398fSOlivier Deprezof:
255fcb1398fSOlivier Deprez
256fcb1398fSOlivier Deprez-  a header
257fcb1398fSOlivier Deprez-  a DTB
258fcb1398fSOlivier Deprez-  an image payload
259fcb1398fSOlivier Deprez
260fcb1398fSOlivier DeprezThe header starts with a magic value and offset values to SP DTB and
261fcb1398fSOlivier Deprezimage payload. Each SP package is loaded independently by BL2 loader
262fcb1398fSOlivier Deprezand verified for authenticity and integrity.
263fcb1398fSOlivier Deprez
264fcb1398fSOlivier DeprezThe SP package identified by its UUID (matching FF-A uuid) is inserted
265fcb1398fSOlivier Deprezas a single entry into the FIP at end of the TF-A build flow as shown:
266fcb1398fSOlivier Deprez
267fcb1398fSOlivier Deprez.. code:: shell
268fcb1398fSOlivier Deprez
269fcb1398fSOlivier Deprez    Trusted Boot Firmware BL2: offset=0x1F0, size=0x8AE1, cmdline="--tb-fw"
270fcb1398fSOlivier Deprez    EL3 Runtime Firmware BL31: offset=0x8CD1, size=0x13000, cmdline="--soc-fw"
271fcb1398fSOlivier Deprez    Secure Payload BL32 (Trusted OS): offset=0x1BCD1, size=0x15270, cmdline="--tos-fw"
272fcb1398fSOlivier Deprez    Non-Trusted Firmware BL33: offset=0x30F41, size=0x92E0, cmdline="--nt-fw"
273fcb1398fSOlivier Deprez    HW_CONFIG: offset=0x3A221, size=0x2348, cmdline="--hw-config"
274fcb1398fSOlivier Deprez    TB_FW_CONFIG: offset=0x3C569, size=0x37A, cmdline="--tb-fw-config"
275fcb1398fSOlivier Deprez    SOC_FW_CONFIG: offset=0x3C8E3, size=0x48, cmdline="--soc-fw-config"
276fcb1398fSOlivier Deprez    TOS_FW_CONFIG: offset=0x3C92B, size=0x427, cmdline="--tos-fw-config"
277fcb1398fSOlivier Deprez    NT_FW_CONFIG: offset=0x3CD52, size=0x48, cmdline="--nt-fw-config"
278fcb1398fSOlivier Deprez    B4B5671E-4A90-4FE1-B81F-FB13DAE1DACB: offset=0x3CD9A, size=0xC168, cmdline="--blob"
279fcb1398fSOlivier Deprez    D1582309-F023-47B9-827C-4464F5578FC8: offset=0x48F02, size=0xC168, cmdline="--blob"
280fcb1398fSOlivier Deprez
281fcb1398fSOlivier Deprez.. uml:: ../resources/diagrams/plantuml/fip-secure-partitions.puml
282fcb1398fSOlivier Deprez
283fcb1398fSOlivier DeprezSpecifying partition binary image and DT
284fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
285fcb1398fSOlivier Deprez
286fcb1398fSOlivier DeprezA description file (json format) is passed to the build flow specifying
287fcb1398fSOlivier Deprezpaths to the SP binary image and associated DTS partition manifest file.
288fcb1398fSOlivier DeprezThe latter is going through the dtc compiler to generate the dtb fed into
289fcb1398fSOlivier Deprezthe SP package.
2900901d339SManish PandeyThis file also specifies the owner of the SP, which is an optional field and
2910901d339SManish Pandeyidentifies the signing domain in case of dualroot CoT.
2920901d339SManish PandeyThe possible owner of an SP could either be Silicon Provider or Platform, and
2930901d339SManish Pandeythe corresponding "owner" field value could either be "SiP" or "Plat".
2940901d339SManish PandeyIn absence of "owner" field, it defaults to "SiP".
295fcb1398fSOlivier Deprez
296fcb1398fSOlivier Deprez.. code:: shell
297fcb1398fSOlivier Deprez
298fcb1398fSOlivier Deprez    {
299fcb1398fSOlivier Deprez        "tee1" : {
300fcb1398fSOlivier Deprez            "image": "tee1.bin",
3010901d339SManish Pandey             "pm": "tee1.dts",
3020901d339SManish Pandey             "owner": "SiP"
303fcb1398fSOlivier Deprez        },
304fcb1398fSOlivier Deprez
305fcb1398fSOlivier Deprez        "tee2" : {
306fcb1398fSOlivier Deprez            "image": "tee2.bin",
3070901d339SManish Pandey            "pm": "tee2.dts",
3080901d339SManish Pandey            "owner": "Plat"
309fcb1398fSOlivier Deprez        }
310fcb1398fSOlivier Deprez    }
311fcb1398fSOlivier Deprez
312fcb1398fSOlivier DeprezSPMC manifest
313fcb1398fSOlivier Deprez~~~~~~~~~~~~~
314fcb1398fSOlivier Deprez
315fcb1398fSOlivier DeprezThis manifest contains an SPMC attributes node consumed by SPMD at boot time. It
316fcb1398fSOlivier Deprezis implementing the description from `[1]`_ section 3.2 (SP manifest at physical
317fcb1398fSOlivier DeprezFF-A instance). The SP manifest at physical FF-A instance is used by the SPMD to
318fcb1398fSOlivier Deprezsetup a SP that co-resides with the SPMC and executes at S-EL1 or Secure
319fcb1398fSOlivier DeprezSupervisor mode.
320fcb1398fSOlivier Deprez
321fcb1398fSOlivier DeprezIn this implementation its usage is extended to the secure physical FF-A
322fcb1398fSOlivier Deprezinstance where SPMC executes at S-EL2.
323fcb1398fSOlivier Deprez
324fcb1398fSOlivier Deprez.. code:: shell
325fcb1398fSOlivier Deprez
326fcb1398fSOlivier Deprez    attribute {
327fcb1398fSOlivier Deprez        spmc_id = <0x8000>;
328fcb1398fSOlivier Deprez        maj_ver = <0x1>;
329fcb1398fSOlivier Deprez        min_ver = <0x0>;
330fcb1398fSOlivier Deprez        exec_state = <0x0>;
331fcb1398fSOlivier Deprez        load_address = <0x0 0x6000000>;
332fcb1398fSOlivier Deprez        entrypoint = <0x0 0x6000000>;
333fcb1398fSOlivier Deprez        binary_size = <0x60000>;
334fcb1398fSOlivier Deprez    };
335fcb1398fSOlivier Deprez
336fcb1398fSOlivier Deprez-  *spmc_id* defines the endpoint ID value that SPMC can query through
337fcb1398fSOlivier Deprez   ``FFA_ID_GET``.
338fcb1398fSOlivier Deprez-  *maj_ver/min_ver*. SPMD checks provided version versus its internal
339fcb1398fSOlivier Deprez   version and aborts if not matching.
340fcb1398fSOlivier Deprez-  *exec_state* defines SPMC execution state (can be AArch64 for
341fcb1398fSOlivier Deprez   Hafnium, or AArch64/AArch32 for OP-TEE at S-EL1).
342fcb1398fSOlivier Deprez-  *load_address* and *binary_size* are mostly used to verify secondary
343fcb1398fSOlivier Deprez   entry points fit into the loaded binary image.
344fcb1398fSOlivier Deprez-  *entrypoint* defines the cold boot primary core entry point used by
345fcb1398fSOlivier Deprez   SPMD (currently matches ``BL32_BASE``)
346fcb1398fSOlivier Deprez
347fcb1398fSOlivier DeprezOther nodes in the manifest are consumed by Hafnium in the secure world.
348fcb1398fSOlivier DeprezA sample can be found at [7]:
349fcb1398fSOlivier Deprez
350fcb1398fSOlivier Deprez-  The *chosen* node is currently unused in SWd. It is meant for NWd to
351fcb1398fSOlivier Deprez   specify the init ramdisk image.
352fcb1398fSOlivier Deprez-  The *hypervisor* node describes SPs. *is_ffa_partition* boolean
353fcb1398fSOlivier Deprez   attribute indicates an SP. Load-addr field specifies the load address
354fcb1398fSOlivier Deprez   at which TF-A loaded the SP package.
355fcb1398fSOlivier Deprez-  *cpus* node provide the platform topology and allows MPIDR to VMPIDR
356fcb1398fSOlivier Deprez   mapping. Notice with current implementation primary cpu is declared
357fcb1398fSOlivier Deprez   first, then secondary cpus must be declared in reverse order.
358fcb1398fSOlivier Deprez
359fcb1398fSOlivier DeprezSPMC boot
360fcb1398fSOlivier Deprez~~~~~~~~~
361fcb1398fSOlivier Deprez
362fcb1398fSOlivier DeprezThe SPMC is loaded by BL2 as the BL32 image.
363fcb1398fSOlivier Deprez
364fcb1398fSOlivier DeprezThe SPMC manifest is loaded by BL2 as the ``TOS_FW_CONFIG`` image.
365fcb1398fSOlivier Deprez
366fcb1398fSOlivier DeprezBL2 passes the SPMC manifest address to BL31 through a register.
367fcb1398fSOlivier Deprez
368fcb1398fSOlivier DeprezBL31(SPMD) runs from primary core, initializes the core contexts and
369fcb1398fSOlivier Deprezlaunches BL32 passing the SPMC manifest address through a register.
370fcb1398fSOlivier Deprez
371fcb1398fSOlivier DeprezLoading of SPs
372fcb1398fSOlivier Deprez~~~~~~~~~~~~~~
373fcb1398fSOlivier Deprez
374fcb1398fSOlivier Deprez.. uml:: ../resources/diagrams/plantuml/bl2-loading-sp.puml
375fcb1398fSOlivier Deprez
376fcb1398fSOlivier Deprez
377fcb1398fSOlivier DeprezNotice this boot flow is an implementation sample on Arm's FVP platform. Platforms
378fcb1398fSOlivier Depreznot using FW_CONFIG would adjust to a different implementation.
379fcb1398fSOlivier Deprez
380fcb1398fSOlivier DeprezSecure boot
381fcb1398fSOlivier Deprez~~~~~~~~~~~
382fcb1398fSOlivier Deprez
383fcb1398fSOlivier DeprezThe SP content certificate is inserted as a separate FIP item so that BL2 loads SPMC,
384fcb1398fSOlivier DeprezSPMC manifest and Secure Partitions and verifies them for authenticity and integrity.
385fcb1398fSOlivier DeprezRefer to TBBR specification `[3]`_.
386fcb1398fSOlivier Deprez
387fcb1398fSOlivier DeprezThe multiple-signing domain feature (in current state dual signing domain) allows
388fcb1398fSOlivier Deprezthe use of two root keys namely S-ROTPK and NS-ROTPK (see `[8]`_):
389fcb1398fSOlivier Deprez
3900901d339SManish Pandey-  SPMC (BL32) and SPMC manifest are signed by the SiP using the S-ROTPK.
391fcb1398fSOlivier Deprez-  BL33 may be signed by the OEM using NS-ROTPK.
3920901d339SManish Pandey-  An SP may be signed either by SiP (using S-ROTPK) or by OEM (using NS-ROTPK).
393fcb1398fSOlivier Deprez
394fcb1398fSOlivier DeprezLonger term multiple signing domain will allow additional signing keys, e.g.
395fcb1398fSOlivier Deprezif SPs originate from different parties.
396fcb1398fSOlivier Deprez
397fcb1398fSOlivier DeprezSee `TF-A build options`_ for a sample build command line.
398fcb1398fSOlivier Deprez
399fcb1398fSOlivier DeprezHafnium in the secure world
400fcb1398fSOlivier Deprez===========================
401fcb1398fSOlivier Deprez
402fcb1398fSOlivier Deprez**NOTE: this section is work in progress. Descriptions and implementation choices
403fcb1398fSOlivier Deprezare subject to evolve.**
404fcb1398fSOlivier Deprez
405fcb1398fSOlivier DeprezGeneral considerations
406fcb1398fSOlivier Deprez----------------------
407fcb1398fSOlivier Deprez
408fcb1398fSOlivier DeprezBuild platform for the secure world
409fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
410fcb1398fSOlivier Deprez
411fcb1398fSOlivier DeprezThe implementation might add specific code parts only relevant to the
412fcb1398fSOlivier Deprezsecure world. Such code parts might be isolated into different files
413fcb1398fSOlivier Deprezand/or conditional code enclosed by a ``SECURE_WORLD`` macro.
414fcb1398fSOlivier Deprez
415fcb1398fSOlivier DeprezSecure Partitions CPU scheduling
416fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
417fcb1398fSOlivier Deprez
418fcb1398fSOlivier DeprezIn the normal world, VMs are scheduled by the FFA_RUN ABI invoked from the
419fcb1398fSOlivier Deprezprimary scheduler (in the primary VM), or by a direct message request or
420fcb1398fSOlivier Deprezresponse.
421fcb1398fSOlivier Deprez
422fcb1398fSOlivier DeprezWith the FF-A EAC specification, Secure Partitions are scheduled by direct
423fcb1398fSOlivier Deprezmessage invocations from a NWd VM or another SP.
424fcb1398fSOlivier Deprez
425fcb1398fSOlivier DeprezPlatform topology
426fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~
427fcb1398fSOlivier Deprez
428fcb1398fSOlivier DeprezAs stated in `[1]`_ section 4.4.1 the SPMC implementation assumes the
429fcb1398fSOlivier Deprezfollowing SP types:
430fcb1398fSOlivier Deprez
431fcb1398fSOlivier Deprez-  Pinned MP SPs: an Execution Context id matches a physical PE id. MP
432fcb1398fSOlivier Deprez   SPs must implement the same number of ECs as the number of PEs in the
433fcb1398fSOlivier Deprez   platform. Hence the *execution-ctx-count* as defined by
434fcb1398fSOlivier Deprez   `[1]`_ (or NWd-Hafnium *vcpu_count*) can only take the
435fcb1398fSOlivier Deprez   value of one or the number of physical PEs.
436fcb1398fSOlivier Deprez-  Migratable UP SPs: a single execution context can run and be migrated
437fcb1398fSOlivier Deprez   on any physical PE. It declares a single EC in its SP manifest. An UP
438fcb1398fSOlivier Deprez   SP can receive a direct message request on any physical core.
439fcb1398fSOlivier Deprez
440fcb1398fSOlivier DeprezUsage of PSCI services in the secure world
441fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
442fcb1398fSOlivier Deprez
443fcb1398fSOlivier Deprez- The normal world Hypervisor (optional) or OS kernel issues PSCI service
444fcb1398fSOlivier Deprez  invocations e.g. to request PSCI version, wake-up a secondary core, or request
445fcb1398fSOlivier Deprez  core suspend. This happens at the non-secure physical FF-A instance. In the
446fcb1398fSOlivier Deprez  example case of Hafnium in the normal world, it boots on the primary core and
447fcb1398fSOlivier Deprez  one of the first initialization step is to request the PSCI version. It then
448fcb1398fSOlivier Deprez  launches the primary VM. The primary VM upon initializing performs PSCI service
449fcb1398fSOlivier Deprez  calls (at non-secure virtual FF-A instance) which are trapped by the
450fcb1398fSOlivier Deprez  Hypervisor. Invocation from OS Kernel ends straight at EL3. The PVM issues
451fcb1398fSOlivier Deprez  ``PSCI_CPU_ON`` service calls to wake-up secondary cores by passing an
452fcb1398fSOlivier Deprez  ``MPIDR``, entry point address and a CPU context address. The EL3 PSCI layer
453fcb1398fSOlivier Deprez  then performs an exception return to the secondary core entry point on the
454fcb1398fSOlivier Deprez  targeted core. Other PSCI calls can happen at run-time from the PVM e.g. to
455fcb1398fSOlivier Deprez  request core suspend.
456fcb1398fSOlivier Deprez- In the existing TF-A PSCI standard library, PSCI service calls are filtered at
457fcb1398fSOlivier Deprez  EL3 to only originate from the NWd. Thus concerning the SPMC (at secure
458fcb1398fSOlivier Deprez  physical FF-A instance) the PSCI service invocations cannot happen as in the
459fcb1398fSOlivier Deprez  normal world. For example, a ``PSCI_CPU_ON`` service invocation from the SPMC
460fcb1398fSOlivier Deprez  does not reach the PSCI layer.
461fcb1398fSOlivier Deprez
462fcb1398fSOlivier DeprezParsing SP partition manifests
463fcb1398fSOlivier Deprez------------------------------
464fcb1398fSOlivier Deprez
465fcb1398fSOlivier DeprezHafnium must be able to consume SP manifests as defined in
466fcb1398fSOlivier Deprez`[1]`_ section 3.1, at least for the mandatory fields.
467fcb1398fSOlivier Deprez
468fcb1398fSOlivier DeprezThe SP manifest may contain memory and device regions nodes.
469fcb1398fSOlivier Deprez
470fcb1398fSOlivier Deprez-  Memory regions shall be mapped in the SP Stage-2 translation regime at
471fcb1398fSOlivier Deprez   load time. A memory region node can specify RX/TX buffer regions in which
472fcb1398fSOlivier Deprez   case it is not necessary for an SP to explicitly call the ``FFA_RXTX_MAP``
473fcb1398fSOlivier Deprez   service.
474fcb1398fSOlivier Deprez-  Device regions shall be mapped in SP Stage-2 translation regime as
475fcb1398fSOlivier Deprez   peripherals and possibly allocate additional resources (e.g. interrupts)
476fcb1398fSOlivier Deprez
477fcb1398fSOlivier DeprezBase addresses for memory and device region nodes are IPAs provided SPMC
478fcb1398fSOlivier Deprezidentity maps IPAs to PAs within SP Stage-2 translation regime.
479fcb1398fSOlivier Deprez
480fcb1398fSOlivier DeprezNote: currently both VTTBR_EL2 and VSTTBR_EL2 resolve to the same set of page
481fcb1398fSOlivier Depreztables. It is still open whether two sets of page tables shall be provided per
482fcb1398fSOlivier DeprezSP. The memory region node as defined in the spec (section 3.1 Table 10)
483fcb1398fSOlivier Deprezprovides a memory security attribute hinting to map either to the secure or
484fcb1398fSOlivier Depreznon-secure stage-2 table.
485fcb1398fSOlivier Deprez
486fcb1398fSOlivier DeprezPassing boot data to the SP
487fcb1398fSOlivier Deprez---------------------------
488fcb1398fSOlivier Deprez
489fcb1398fSOlivier Deprez`[1]`_ Section 3.4.2 “Protocol for passing data” defines a
490fcb1398fSOlivier Deprezmethod to passing boot data to SPs (not currently implemented).
491fcb1398fSOlivier Deprez
492fcb1398fSOlivier DeprezProvided that the whole Secure Partition package image (see `Secure
493fcb1398fSOlivier DeprezPartition packages`_) is mapped to the SP's secure Stage-2 translation
494fcb1398fSOlivier Deprezregime, an SP can access its own manifest DTB blob and extract its partition
495fcb1398fSOlivier Deprezmanifest properties.
496fcb1398fSOlivier Deprez
497fcb1398fSOlivier DeprezSP Boot order
498fcb1398fSOlivier Deprez-------------
499fcb1398fSOlivier Deprez
500fcb1398fSOlivier DeprezSP manifests provide an optional boot order attribute meant to resolve
501fcb1398fSOlivier Deprezdependencies such as an SP providing a service required to properly boot
502fcb1398fSOlivier Deprezanother SP.
503fcb1398fSOlivier Deprez
504fcb1398fSOlivier DeprezBoot phases
505fcb1398fSOlivier Deprez-----------
506fcb1398fSOlivier Deprez
507fcb1398fSOlivier DeprezPrimary core boot-up
508fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~~
509fcb1398fSOlivier Deprez
510fcb1398fSOlivier DeprezThe SPMC performs its platform initializations then loads and creates
511fcb1398fSOlivier Deprezsecure partitions based on SP packages and manifests. Then each secure
512fcb1398fSOlivier Deprezpartition is launched in sequence (see `SP Boot order`_) on their primary
513fcb1398fSOlivier DeprezExecution Context.
514fcb1398fSOlivier Deprez
515fcb1398fSOlivier DeprezNotice the primary physical core may not be core 0. Hence if the primary
516fcb1398fSOlivier Deprezcore linear id is N, the 1:1 mapping requires MP SPs are launched using
517fcb1398fSOlivier DeprezEC[N] on PE[N] (see `Platform topology`_).
518fcb1398fSOlivier Deprez
519fcb1398fSOlivier DeprezThe SP's primary Execution Context (or the EC used when the partition is booted)
520fcb1398fSOlivier Deprezexits through ``FFA_MSG_WAIT`` to indicate successful initialization.
521fcb1398fSOlivier Deprez
522fcb1398fSOlivier DeprezSecondary physical core boot-up
523fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
524fcb1398fSOlivier Deprez
525fcb1398fSOlivier DeprezUpon boot-up, the SPMC running on the primary core performs
526fcb1398fSOlivier Deprezimplementation-defined SPMD service calls at secure physical FF-A instance
527fcb1398fSOlivier Deprezto register the secondary physical cores entry points and context information:
528fcb1398fSOlivier Deprez
529fcb1398fSOlivier Deprez-  This is done through a direct message request invocation to the SPMD
530fcb1398fSOlivier Deprez   (``SET_ENTRY_POINT``). This service call does not wake-up the targeted
531fcb1398fSOlivier Deprez   core immediately. The secondary core is woken up later by a NWd
532fcb1398fSOlivier Deprez   ``PSCI_CPU_ON`` service invocation. A notification is passed from EL3
533fcb1398fSOlivier Deprez   PSCI layer to the SPMD, and then to SPMC through an implementation-defined
534fcb1398fSOlivier Deprez   interface.
535fcb1398fSOlivier Deprez-  The SPMC/SPMD interface can consist of FF-A direct message requests/responses
536fcb1398fSOlivier Deprez   transporting PM events.
537fcb1398fSOlivier Deprez
538fcb1398fSOlivier DeprezIf there is no Hypervisor in the normal world, the OS Kernel issues
539fcb1398fSOlivier Deprez``PSCI_CPU_ON`` calls that are directly trapped to EL3.
540fcb1398fSOlivier Deprez
541fcb1398fSOlivier DeprezWhen a secondary physical core wakes-up the SPMD notifies the SPMC which updates
542fcb1398fSOlivier Deprezits internal states reflecting current physical core is being turned on.
543fcb1398fSOlivier DeprezIt might then return straight to the SPMD and then to the NWd.
544fcb1398fSOlivier Deprez
545fcb1398fSOlivier Deprez*(under discussion)* There may be possibility that an SP registers "PM events"
546fcb1398fSOlivier Deprez(during primary EC boot stage) through an ad-hoc interface. Such events would
547fcb1398fSOlivier Deprezbe relayed by SPMC to one or more registered SPs on need basis
548fcb1398fSOlivier Deprez(see `Power management`_).
549fcb1398fSOlivier Deprez
550fcb1398fSOlivier DeprezSecondary virtual core boot-up
551fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
552fcb1398fSOlivier Deprez
553fcb1398fSOlivier DeprezIn the example case where Hafnium exists in the normal world, secondary VMs
554fcb1398fSOlivier Deprezissue a ``PSCI_CPU_ON`` service call which is trapped to the Hypervisor. The
555fcb1398fSOlivier Deprezlatter then enables the vCPU context for the targeted core, and switches to
556fcb1398fSOlivier Deprezthe PVM down to the kernel driver with an ``HF_WAKE_UP`` message. The NWd
557fcb1398fSOlivier Deprezdriver in PVM can then schedule the newly woken up vCPU context.
558fcb1398fSOlivier Deprez
559fcb1398fSOlivier DeprezIn the secure world the primary EC of a given SP passes the secondary EC entry
560fcb1398fSOlivier Deprezpoint and context. The SMC service call is trapped into the SPMC. This can be
561fcb1398fSOlivier Deprezeither *(under discussion)*:
562fcb1398fSOlivier Deprez
563fcb1398fSOlivier Deprez-  a specific interface registering the secondary EC entry point,
564fcb1398fSOlivier Deprez   similarly to above ``SET_ENTRY_POINT`` service.
565fcb1398fSOlivier Deprez-  Re-purposing the ``PSCI_CPU_ON`` function id. It is
566fcb1398fSOlivier Deprez   assumed that even if the input arguments are the same as the ones defined in
567fcb1398fSOlivier Deprez   the PSCI standard, the usage deviates by the fact the secondary EC is not
568fcb1398fSOlivier Deprez   woken up immediately. At least for the PSA-FF-A EAC where only
569fcb1398fSOlivier Deprez   direct messaging is allowed, it is only after the first direct
570fcb1398fSOlivier Deprez   message invocation that the secondary EC is entered. This option
571fcb1398fSOlivier Deprez   might be preferred when the same code base is re-used for a VM or
572fcb1398fSOlivier Deprez   an SP. The ABI to wake-up a secondary EC can remain similar.
573fcb1398fSOlivier Deprez
574fcb1398fSOlivier DeprezSPs are always scheduled from the NWd, this paradigm did not change from legacy
575fcb1398fSOlivier DeprezTEEs. There must always be some logic (or driver) in the NWd to relinquish CPU
576fcb1398fSOlivier Deprezcycles to the SWd. If primary core is 0, an SP EC[x>0] entry point is supplied
577fcb1398fSOlivier Deprezby the SP EC[0] when the system boots in SWd. But this EC[x] is not immediately
578fcb1398fSOlivier Deprezentered at boot. Later in the boot process when NWd is up, a direct message
579fcb1398fSOlivier Deprezrequest issued from physical core 1 ends up in SP EC[1], and only at this stage
580fcb1398fSOlivier Deprezthis context is effectively scheduled.
581fcb1398fSOlivier Deprez
582fcb1398fSOlivier DeprezIt should be possible for an SP to call into another SP through direct message
583fcb1398fSOlivier Deprezprovided the latter SP has been booted already. The "boot-order" field in
584fcb1398fSOlivier Deprezpartition manifests (`SP Boot order`_) fulfills the dependency towards availability
585fcb1398fSOlivier Deprezof a service within an SP offered to another SP.
586fcb1398fSOlivier Deprez
587fcb1398fSOlivier DeprezMandatory interfaces
588fcb1398fSOlivier Deprez--------------------
589fcb1398fSOlivier Deprez
590fcb1398fSOlivier DeprezThe following interfaces must be exposed to any VM or SP:
591fcb1398fSOlivier Deprez
592fcb1398fSOlivier Deprez-  ``FFA_STATUS``
593fcb1398fSOlivier Deprez-  ``FFA_ERROR``
594fcb1398fSOlivier Deprez-  ``FFA_INTERRUPT``
595fcb1398fSOlivier Deprez-  ``FFA_VERSION``
596fcb1398fSOlivier Deprez-  ``FFA_FEATURES``
597fcb1398fSOlivier Deprez-  ``FFA_RX_RELEASE``
598fcb1398fSOlivier Deprez-  ``FFA_RXTX_MAP``
599fcb1398fSOlivier Deprez-  ``FFA_RXTX_UNMAP``
600fcb1398fSOlivier Deprez-  ``FFA_PARTITION_INFO_GET``
601fcb1398fSOlivier Deprez-  ``FFA_ID_GET``
602fcb1398fSOlivier Deprez
603fcb1398fSOlivier DeprezFFA_VERSION
604fcb1398fSOlivier Deprez~~~~~~~~~~~
605fcb1398fSOlivier Deprez
606fcb1398fSOlivier DeprezPer `[1]`_ section 8.1 ``FFA_VERSION`` requires a
607fcb1398fSOlivier Deprez*requested_version* parameter from the caller.
608fcb1398fSOlivier Deprez
609fcb1398fSOlivier DeprezIn the current implementation when ``FFA_VERSION`` is invoked from:
610fcb1398fSOlivier Deprez
611fcb1398fSOlivier Deprez-  Hypervisor in NS-EL2: the SPMD returns the SPMC version specified
612fcb1398fSOlivier Deprez   in the SPMC manifest.
613fcb1398fSOlivier Deprez-  OS kernel in NS-EL1 when NS-EL2 is not present: the SPMD returns the
614fcb1398fSOlivier Deprez   SPMC version specified in the SPMC manifest.
615fcb1398fSOlivier Deprez-  VM in NWd: the Hypervisor returns its implemented version.
616fcb1398fSOlivier Deprez-  SP in SWd: the SPMC returns its implemented version.
617fcb1398fSOlivier Deprez-  SPMC at S-EL1/S-EL2: the SPMD returns its implemented version.
618fcb1398fSOlivier Deprez
619fcb1398fSOlivier DeprezFFA_FEATURES
620fcb1398fSOlivier Deprez~~~~~~~~~~~~
621fcb1398fSOlivier Deprez
622fcb1398fSOlivier DeprezFF-A features may be discovered by Secure Partitions while booting
623fcb1398fSOlivier Deprezthrough the SPMC. However, SPMC cannot get features from Hypervisor
624fcb1398fSOlivier Deprezearly at boot time as NS world is not setup yet.
625fcb1398fSOlivier Deprez
626fcb1398fSOlivier DeprezThe Hypervisor may decide to gather FF-A features from SPMC through SPMD
627fcb1398fSOlivier Deprezonce at boot time and store the result. Later when a VM requests FF-A
628fcb1398fSOlivier Deprezfeatures, the Hypervisor can adjust its own set of features with what
629fcb1398fSOlivier DeprezSPMC advertised, if necessary. Another approach is to always forward FF-A
630fcb1398fSOlivier Deprezfeatures to the SPMC when a VM requests it to the Hypervisor. Although
631fcb1398fSOlivier Deprezthe result is not supposed to change over time so there may not be added
632fcb1398fSOlivier Deprezvalue doing the systematic forwarding.
633fcb1398fSOlivier Deprez
634fcb1398fSOlivier DeprezFFA_RXTX_MAP/FFA_RXTX_UNMAP
635fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~~~~~~~~~
636fcb1398fSOlivier Deprez
637fcb1398fSOlivier DeprezVM mailboxes are re-purposed to serve as SP RX/TX buffers. The RX/TX
638fcb1398fSOlivier Deprezmap API maps the send and receive buffer IPAs to the SP Stage-2 translation regime.
639fcb1398fSOlivier Deprez
640fcb1398fSOlivier DeprezHafnium in the normal world defines VMs and their attributes as logical structures,
641fcb1398fSOlivier Deprezincluding a mailbox used for FF-A indirect messaging, memory sharing, or the
642fcb1398fSOlivier Deprez`FFA_PARTITION_INFO_GET`_  ABI.
643fcb1398fSOlivier DeprezThis same mailbox structure is re-used in the SPMC. `[1]`_ states only direct
644fcb1398fSOlivier Deprezmessaging is allowed to SPs. Thus mailbox usage is restricted to implementing
645fcb1398fSOlivier Deprez`FFA_PARTITION_INFO_GET`_ and memory sharing ABIs.
646fcb1398fSOlivier Deprez
647fcb1398fSOlivier DeprezFFA_PARTITION_INFO_GET
648fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~~~~
649fcb1398fSOlivier Deprez
650fcb1398fSOlivier DeprezPartition info get service call can originate:
651fcb1398fSOlivier Deprez
652fcb1398fSOlivier Deprez-  from SP to SPM
653fcb1398fSOlivier Deprez-  from VM to Hypervisor
654fcb1398fSOlivier Deprez-  from Hypervisor to SPM
655fcb1398fSOlivier Deprez
656fcb1398fSOlivier DeprezFor the latter case, the service call must be forwarded through the SPMD.
657fcb1398fSOlivier Deprez
658fcb1398fSOlivier DeprezFFA_ID_GET
659fcb1398fSOlivier Deprez~~~~~~~~~~
660fcb1398fSOlivier Deprez
661fcb1398fSOlivier DeprezThe SPMD returns:
662fcb1398fSOlivier Deprez
663fcb1398fSOlivier Deprez-  a default zero value on invocation from the Hypervisor.
664fcb1398fSOlivier Deprez-  The ``spmc_id`` value specified in the SPMC manifest on invocation from
665fcb1398fSOlivier Deprez   the SPMC (see `SPMC manifest`_)
666fcb1398fSOlivier Deprez
667fcb1398fSOlivier DeprezThe FF-A id space is split into a non-secure space and secure space:
668fcb1398fSOlivier Deprez
669fcb1398fSOlivier Deprez-  FF-A id with bit 15 clear refer to normal world VMs.
670fcb1398fSOlivier Deprez-  FF-A id with bit 15 set refer to secure world SPs
671fcb1398fSOlivier Deprez
672fcb1398fSOlivier DeprezSuch convention helps the SPMC discriminating the origin and destination worlds
673fcb1398fSOlivier Deprezin an FF-A service invocation. In particular the SPMC shall filter unauthorized
674fcb1398fSOlivier Depreztransactions in its world switch routine. It must not be permitted for a VM to
675fcb1398fSOlivier Deprezuse a secure FF-A id as origin world through spoofing:
676fcb1398fSOlivier Deprez
677fcb1398fSOlivier Deprez-  A VM-to-SP messaging passing shall have an origin world being non-secure
678fcb1398fSOlivier Deprez   (FF-A id bit 15 clear) and destination world being secure (FF-A id bit 15
679fcb1398fSOlivier Deprez   set).
680fcb1398fSOlivier Deprez-  Similarly, an SP-to-SP message shall have FF-A id bit 15 set for both origin
681fcb1398fSOlivier Deprez   and destination ids.
682fcb1398fSOlivier Deprez
683fcb1398fSOlivier DeprezAn incoming direct message request arriving at SPMD from NWd is forwarded to
684fcb1398fSOlivier DeprezSPMC without a specific check. The SPMC is resumed through eret and "knows" the
685fcb1398fSOlivier Deprezmessage is coming from normal world in this specific code path. Thus the origin
686fcb1398fSOlivier Deprezendpoint id must be checked by SPMC for being a normal world id.
687fcb1398fSOlivier Deprez
688fcb1398fSOlivier DeprezAn SP sending a direct message request must have bit 15 set in its origin
689fcb1398fSOlivier Deprezendpoint id and this can be checked by the SPMC when the SP invokes the ABI.
690fcb1398fSOlivier Deprez
691fcb1398fSOlivier DeprezThe SPMC shall reject the direct message if the claimed world in origin endpoint
692fcb1398fSOlivier Deprezid is not consistent:
693fcb1398fSOlivier Deprez
694fcb1398fSOlivier Deprez-  It is either forwarded by SPMD and thus origin endpoint id must be a "normal
695fcb1398fSOlivier Deprez   world id",
696fcb1398fSOlivier Deprez-  or initiated by an SP and thus origin endpoint id must be a "secure world id".
697fcb1398fSOlivier Deprez
698fcb1398fSOlivier DeprezDirect messaging
699fcb1398fSOlivier Deprez----------------
700fcb1398fSOlivier Deprez
701fcb1398fSOlivier DeprezThis is a mandatory interface for Secure Partitions consisting in direct
702fcb1398fSOlivier Deprezmessage request and responses.
703fcb1398fSOlivier Deprez
704fcb1398fSOlivier DeprezThe ``ffa_handler`` Hafnium function may:
705fcb1398fSOlivier Deprez
706fcb1398fSOlivier Deprez-  trigger a world change e.g. when an SP invokes the direct message
707fcb1398fSOlivier Deprez   response ABI to a VM.
708fcb1398fSOlivier Deprez-  handle multiple requests from the NWd without resuming an SP.
709fcb1398fSOlivier Deprez
710fcb1398fSOlivier DeprezSP-to-SP
711fcb1398fSOlivier Deprez~~~~~~~~
712fcb1398fSOlivier Deprez
713fcb1398fSOlivier Deprez-  An SP can send a direct message request to another SP
714fcb1398fSOlivier Deprez-  An SP can receive a direct message response from another SP.
715fcb1398fSOlivier Deprez
716fcb1398fSOlivier DeprezVM-to-SP
717fcb1398fSOlivier Deprez~~~~~~~~
718fcb1398fSOlivier Deprez
719fcb1398fSOlivier Deprez-  A VM can send a direct message request to an SP
720fcb1398fSOlivier Deprez-  An SP can send a direct message response to a VM
721fcb1398fSOlivier Deprez
722fcb1398fSOlivier DeprezSPMC-SPMD messaging
723fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~
724fcb1398fSOlivier Deprez
725fcb1398fSOlivier DeprezSpecific implementation-defined endpoint IDs are allocated to the SPMC and SPMD.
726fcb1398fSOlivier DeprezReferring those IDs in source/destination fields of a direct message
727fcb1398fSOlivier Deprezrequest/response permits SPMD to SPMC messaging back and forth.
728fcb1398fSOlivier Deprez
729fcb1398fSOlivier DeprezPer `[1]`_ Table 114 Config No. 1 (physical FF-A instance):
730fcb1398fSOlivier Deprez
731fcb1398fSOlivier Deprez-  SPMC=>SPMD direct message request uses SMC conduit
732fcb1398fSOlivier Deprez-  SPMD=>SPMC direct message request uses ERET conduit
733fcb1398fSOlivier Deprez
734fcb1398fSOlivier DeprezPer `[1]`_ Table 118 Config No. 1 (physical FF-A instance):
735fcb1398fSOlivier Deprez
736fcb1398fSOlivier Deprez-  SPMC=>SPMD direct message response uses SMC conduit
737fcb1398fSOlivier Deprez-  SPMD=>SPMC direct message response uses ERET conduit
738fcb1398fSOlivier Deprez
739fcb1398fSOlivier DeprezMemory management
740fcb1398fSOlivier Deprez-----------------
741fcb1398fSOlivier Deprez
742fcb1398fSOlivier DeprezThis section only deals with the PE MMU configuration.
743fcb1398fSOlivier Deprez
744fcb1398fSOlivier DeprezHafnium in the normal world deals with NS buffers only and provisions
745fcb1398fSOlivier Depreza single root page table directory to VMs. In context of S-EL2 enabled
746fcb1398fSOlivier Deprezfirmware, two IPA spaces are output from Stage-1 translation (secure
747fcb1398fSOlivier Deprezand non-secure). The Stage-2 translation handles:
748fcb1398fSOlivier Deprez
749fcb1398fSOlivier Deprez-  A single secure IPA space when an SP Stage-1 MMU is disabled.
750fcb1398fSOlivier Deprez-  Two IPA spaces (secure and non-secure) when Stage-1 MMU is enabled.
751fcb1398fSOlivier Deprez
752fcb1398fSOlivier Deprez``VTCR_EL2`` and ``VSTCR_EL2`` provide additional bits for controlling the
753fcb1398fSOlivier DeprezNS/S IPA translations (``VSTCR_EL2.SW``, ``VSTCR_EL2.SA``, ``VTCR_EL2.NSW``,
754fcb1398fSOlivier Deprez``VTCR_EL2.NSA``). There may be two approaches:
755fcb1398fSOlivier Deprez
756fcb1398fSOlivier Deprez-  secure and non-secure mappings are rooted as two separate root page
757fcb1398fSOlivier Deprez   tables
758fcb1398fSOlivier Deprez-  secure and non-secure mappings use the same root page table. Access
759fcb1398fSOlivier Deprez   from S-EL1 to an NS region translates to a secure physical address
760fcb1398fSOlivier Deprez   space access.
761fcb1398fSOlivier Deprez
762fcb1398fSOlivier DeprezInterrupt management
763fcb1398fSOlivier Deprez--------------------
764fcb1398fSOlivier Deprez
765fcb1398fSOlivier DeprezRoad to a para-virtualized interface
766fcb1398fSOlivier Deprez~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
767fcb1398fSOlivier Deprez
768fcb1398fSOlivier DeprezCurrent Hafnium implementation uses an ad-hoc mechanism for a VM to get
769fcb1398fSOlivier Depreza pending interrupt number through an hypercall. The PVM injects
770fcb1398fSOlivier Deprezinterrupts to VMs by delegation from the Hypervisor. The PVM probes a
771fcb1398fSOlivier Deprezpending interrupt directly from the GIC distributor.
772fcb1398fSOlivier Deprez
773fcb1398fSOlivier DeprezThe short-term plan is to have Hafnium/SPMC in the secure world owner
774fcb1398fSOlivier Deprezof the GIC configuration.
775fcb1398fSOlivier Deprez
776fcb1398fSOlivier DeprezThe SPMC fully owns the GIC configuration at S-EL2. The SPMC manages
777fcb1398fSOlivier Deprezinterrupt resources and allocates interrupt ID based on SP manifests.
778fcb1398fSOlivier DeprezThe SPMC acknowledges physical interrupts and injects virtual interrupts
779fcb1398fSOlivier Deprezby setting the vIRQ bit when resuming an SP. A Secure Partition gathers
780fcb1398fSOlivier Deprezthe interrupt number through an hypercall.
781fcb1398fSOlivier Deprez
782fcb1398fSOlivier DeprezNotice the SPMC/SPMD has to handle Group0 secure interrupts in addition
783fcb1398fSOlivier Deprezto Group1 S/NS interrupts.
784fcb1398fSOlivier Deprez
785fcb1398fSOlivier DeprezPower management
786fcb1398fSOlivier Deprez----------------
787fcb1398fSOlivier Deprez
788fcb1398fSOlivier DeprezAssumption on the Nwd:
789fcb1398fSOlivier Deprez
790fcb1398fSOlivier Deprez-  NWd is the best candidate to own the platform Power Management
791fcb1398fSOlivier Deprez   policy. It is master to invoking PSCI service calls from physical
792fcb1398fSOlivier Deprez   CPUs.
793fcb1398fSOlivier Deprez-  EL3 monitor is in charge of the PM control part (its PSCI layer
794fcb1398fSOlivier Deprez   actually writing to platform registers).
795fcb1398fSOlivier Deprez-  It is fine for the Hypervisor to trap PSCI calls and relay to EL3, or
796fcb1398fSOlivier Deprez   OS kernel driver to emit PSCI service calls.
797fcb1398fSOlivier Deprez
798fcb1398fSOlivier DeprezPSCI notification are relayed through the SPMD/SPD PM hooks to the SPMC.
799fcb1398fSOlivier DeprezThis can either be through re-use of PSCI FIDs or an FF-A direct message
800fcb1398fSOlivier Deprezfrom SPMD to SPMC.
801fcb1398fSOlivier Deprez
802fcb1398fSOlivier DeprezThe SPMD performs an exception return to the SPMC which is resumed to
803fcb1398fSOlivier Deprezits ``eret_handler`` routine. It is then either consuming a PSCI FID or
804fcb1398fSOlivier Deprezan FF-A FID. Depending on the servicing, the SPMC may return directly to
805fcb1398fSOlivier Deprezthe SPMD (and then NWd) without resuming an SP at this stage. An example
806fcb1398fSOlivier Deprezof this is invocation of ``FFA_PARTITION_INFO_GET`` from NWd relayed by
807fcb1398fSOlivier Deprezthe SPMD to the SPMC. The SPMC returns the needed partition information
808fcb1398fSOlivier Deprezto the SPMD (then NWd) without actually resuming a partition in secure world.
809fcb1398fSOlivier Deprez
810fcb1398fSOlivier Deprez*(under discussion)*
811fcb1398fSOlivier DeprezAbout using PSCI FIDs from SPMD to SPMC to notify of PM events, it is still
812fcb1398fSOlivier Deprezquestioned what to use as the return code from the SPMC.
813fcb1398fSOlivier DeprezIf the function ID used by the SPMC is not an FF-A ID when doing SMC, then the
814fcb1398fSOlivier DeprezEL3 std svc handler won't route the response to the SPMD. That's where comes the
815fcb1398fSOlivier Deprezidea to embed the notification into an FF-A message. The SPMC can discriminate
816fcb1398fSOlivier Deprezthis message as being a PSCI event, process it, and reply with an FF-A return
817fcb1398fSOlivier Deprezmessage that the SPMD receives as an acknowledgement.
818fcb1398fSOlivier Deprez
819fcb1398fSOlivier DeprezSP notification
820fcb1398fSOlivier Deprez---------------
821fcb1398fSOlivier Deprez
822fcb1398fSOlivier DeprezPower management notifications are conveyed from PSCI library to the
823fcb1398fSOlivier DeprezSPMD / SPD hooks. A range of events can be relayed to SPMC.
824fcb1398fSOlivier Deprez
825fcb1398fSOlivier DeprezSPs may need to be notified about specific PM events.
826fcb1398fSOlivier Deprez
827fcb1398fSOlivier Deprez-  SPs might register PM events to the SPMC
828fcb1398fSOlivier Deprez-  On SPMD to SPMC notification, a limited range of SPs may be notified
829fcb1398fSOlivier Deprez   through a direct message.
830fcb1398fSOlivier Deprez-  This assumes the mentioned SPs supports managed exit.
831fcb1398fSOlivier Deprez
832fcb1398fSOlivier DeprezThe SPMC is the first to be notified about PM events from the SPMD. It is up
833fcb1398fSOlivier Deprezto the SPMC to arbitrate to which SP it needs to send PM events.
834fcb1398fSOlivier DeprezAn SP explicitly registers to receive notifications to specific PM events.
835fcb1398fSOlivier DeprezThe register operation can either be an implementation-defined service call
836fcb1398fSOlivier Deprezto the SPMC when the primary SP EC boots, or be supplied through the SP
837fcb1398fSOlivier Deprezmanifest.
838fcb1398fSOlivier Deprez
839*4ec3ccb4SMadhukar PappireddySupport for SMMUv3 in Hafnium
840*4ec3ccb4SMadhukar Pappireddy=============================
841*4ec3ccb4SMadhukar Pappireddy
842*4ec3ccb4SMadhukar PappireddyAn SMMU is analogous to an MMU in a CPU. It performs address translations for
843*4ec3ccb4SMadhukar PappireddyDirect Memory Access (DMA) requests from system I/O devices.
844*4ec3ccb4SMadhukar PappireddyThe responsibilities of an SMMU include:
845*4ec3ccb4SMadhukar Pappireddy
846*4ec3ccb4SMadhukar Pappireddy-  Translation: Incoming DMA requests are translated from bus address space to
847*4ec3ccb4SMadhukar Pappireddy   system physical address space using translation tables compliant to
848*4ec3ccb4SMadhukar Pappireddy   Armv8/Armv7 VMSA descriptor format.
849*4ec3ccb4SMadhukar Pappireddy-  Protection: An I/O device can be prohibited from read, write access to a
850*4ec3ccb4SMadhukar Pappireddy   memory region or allowed.
851*4ec3ccb4SMadhukar Pappireddy-  Isolation: Traffic from each individial device can be independently managed.
852*4ec3ccb4SMadhukar Pappireddy   The devices are differentiated from each other using unique translation
853*4ec3ccb4SMadhukar Pappireddy   tables.
854*4ec3ccb4SMadhukar Pappireddy
855*4ec3ccb4SMadhukar PappireddyThe following diagram illustrates a typical SMMU IP integrated in a SoC with
856*4ec3ccb4SMadhukar Pappireddyseveral I/O devices along with Interconnect and Memory system.
857*4ec3ccb4SMadhukar Pappireddy
858*4ec3ccb4SMadhukar Pappireddy.. image:: ../resources/diagrams/MMU-600.png
859*4ec3ccb4SMadhukar Pappireddy
860*4ec3ccb4SMadhukar PappireddySMMU has several versions including SMMUv1, SMMUv2 and SMMUv3. Hafnium provides
861*4ec3ccb4SMadhukar Pappireddysupport for SMMUv3 driver in both Normal and Secure World. A brief introduction
862*4ec3ccb4SMadhukar Pappireddyof SMMUv3 functionality and the corresponding software support in Hafnium is
863*4ec3ccb4SMadhukar Pappireddyprovided here.
864*4ec3ccb4SMadhukar Pappireddy
865*4ec3ccb4SMadhukar PappireddySMMUv3 features
866*4ec3ccb4SMadhukar Pappireddy---------------
867*4ec3ccb4SMadhukar Pappireddy
868*4ec3ccb4SMadhukar Pappireddy-  SMMUv3 provides Stage1, Stage2 translation as well as nested (Stage1 + Stage2)
869*4ec3ccb4SMadhukar Pappireddy   translation support. It can either bypass or abort incoming translations as
870*4ec3ccb4SMadhukar Pappireddy   well.
871*4ec3ccb4SMadhukar Pappireddy-  Traffic (memory transactions) from each upstream I/O peripheral device,
872*4ec3ccb4SMadhukar Pappireddy   referred to as Stream, can be independently managed using a combination of
873*4ec3ccb4SMadhukar Pappireddy   several memory based configuration structures. This allows the SMMUv3 to
874*4ec3ccb4SMadhukar Pappireddy   support a large number of streams with each stream assigned to a unique
875*4ec3ccb4SMadhukar Pappireddy   translation context.
876*4ec3ccb4SMadhukar Pappireddy-  Support for Armv8.1 VMSA where the SMMU shares the translation tables with
877*4ec3ccb4SMadhukar Pappireddy   a Processing Element. AArch32(LPAE) and AArch64 translation table format
878*4ec3ccb4SMadhukar Pappireddy   are supported by SMMUv3.
879*4ec3ccb4SMadhukar Pappireddy-  SMMUv3 offers non-secure stream support with secure stream support being
880*4ec3ccb4SMadhukar Pappireddy   optional. Logically, SMMUv3 behaves as if there is an indepdendent SMMU
881*4ec3ccb4SMadhukar Pappireddy   instance for secure and non-secure stream support.
882*4ec3ccb4SMadhukar Pappireddy-  It also supports sub-streams to differentiate traffic from a virtualized
883*4ec3ccb4SMadhukar Pappireddy   peripheral associated with a VM/SP.
884*4ec3ccb4SMadhukar Pappireddy-  Additionally, SMMUv3.2 provides support for PEs implementing Armv8.4-A
885*4ec3ccb4SMadhukar Pappireddy   extensions. Consequently, SPM depends on Secure EL2 support in SMMUv3.2
886*4ec3ccb4SMadhukar Pappireddy   for providing Secure Stage2 translation support to upstream peripheral
887*4ec3ccb4SMadhukar Pappireddy   devices.
888*4ec3ccb4SMadhukar Pappireddy
889*4ec3ccb4SMadhukar PappireddySMMUv3 Programming Interfaces
890*4ec3ccb4SMadhukar Pappireddy-----------------------------
891*4ec3ccb4SMadhukar Pappireddy
892*4ec3ccb4SMadhukar PappireddySMMUv3 has three software interfaces that are used by the Hafnium driver to
893*4ec3ccb4SMadhukar Pappireddyconfigure the behaviour of SMMUv3 and manage the streams.
894*4ec3ccb4SMadhukar Pappireddy
895*4ec3ccb4SMadhukar Pappireddy-  Memory based data strutures that provide unique translation context for
896*4ec3ccb4SMadhukar Pappireddy   each stream.
897*4ec3ccb4SMadhukar Pappireddy-  Memory based circular buffers for command queue and event queue.
898*4ec3ccb4SMadhukar Pappireddy-  A large number of SMMU configuration registers that are memory mapped during
899*4ec3ccb4SMadhukar Pappireddy   boot time by Hafnium driver. Except a few registers, all configuration
900*4ec3ccb4SMadhukar Pappireddy   registers have independent secure and non-secure versions to configure the
901*4ec3ccb4SMadhukar Pappireddy   behaviour of SMMUv3 for translation of secure and non-secure streams
902*4ec3ccb4SMadhukar Pappireddy   respectively.
903*4ec3ccb4SMadhukar Pappireddy
904*4ec3ccb4SMadhukar PappireddyPeripheral device manifest
905*4ec3ccb4SMadhukar Pappireddy--------------------------
906*4ec3ccb4SMadhukar Pappireddy
907*4ec3ccb4SMadhukar PappireddyCurrently, SMMUv3 driver in Hafnium only supports dependent peripheral devices.
908*4ec3ccb4SMadhukar PappireddyThese devices are dependent on PE endpoint to initiate and receive memory
909*4ec3ccb4SMadhukar Pappireddymanagement transactions on their behalf. The acccess to the MMIO regions of
910*4ec3ccb4SMadhukar Pappireddyany such device is assigned to the endpoint during boot. Moreover, SMMUv3 driver
911*4ec3ccb4SMadhukar Pappireddyuses the same stage 2 translations for the device as those used by partition
912*4ec3ccb4SMadhukar Pappireddymanager on behalf of the PE endpoint. This ensures that the peripheral device
913*4ec3ccb4SMadhukar Pappireddyhas the same visibility of the physical address space as the endpoint. The
914*4ec3ccb4SMadhukar Pappireddydevice node of the corresponding partition manifest (refer to `[1]`_ section 3.2
915*4ec3ccb4SMadhukar Pappireddy) must specify these additional properties for each peripheral device in the
916*4ec3ccb4SMadhukar Pappireddysystem :
917*4ec3ccb4SMadhukar Pappireddy
918*4ec3ccb4SMadhukar Pappireddy-  smmu-id: This field helps to identify the SMMU instance that this device is
919*4ec3ccb4SMadhukar Pappireddy   upstream of.
920*4ec3ccb4SMadhukar Pappireddy-  stream-ids: List of stream IDs assigned to this device.
921*4ec3ccb4SMadhukar Pappireddy
922*4ec3ccb4SMadhukar Pappireddy.. code:: shell
923*4ec3ccb4SMadhukar Pappireddy
924*4ec3ccb4SMadhukar Pappireddy    smmuv3-testengine {
925*4ec3ccb4SMadhukar Pappireddy        base-address = <0x00000000 0x2bfe0000>;
926*4ec3ccb4SMadhukar Pappireddy        pages-count = <32>;
927*4ec3ccb4SMadhukar Pappireddy        attributes = <0x3>;
928*4ec3ccb4SMadhukar Pappireddy        smmu-id = <0>;
929*4ec3ccb4SMadhukar Pappireddy        stream-ids = <0x0 0x1>;
930*4ec3ccb4SMadhukar Pappireddy        interrupts = <0x2 0x3>, <0x4 0x5>;
931*4ec3ccb4SMadhukar Pappireddy        exclusive-access;
932*4ec3ccb4SMadhukar Pappireddy    };
933*4ec3ccb4SMadhukar Pappireddy
934*4ec3ccb4SMadhukar PappireddySMMUv3 driver limitations
935*4ec3ccb4SMadhukar Pappireddy-------------------------
936*4ec3ccb4SMadhukar Pappireddy
937*4ec3ccb4SMadhukar PappireddyThe primary design goal for the Hafnium SMMU driver is to support secure
938*4ec3ccb4SMadhukar Pappireddystreams.
939*4ec3ccb4SMadhukar Pappireddy
940*4ec3ccb4SMadhukar Pappireddy-  Currently, the driver only supports Stage2 translations. No support for
941*4ec3ccb4SMadhukar Pappireddy   Stage1 or nested translations.
942*4ec3ccb4SMadhukar Pappireddy-  Supports only AArch64 translation format.
943*4ec3ccb4SMadhukar Pappireddy-  No support for features such as PCI Express (PASIDs, ATS, PRI), MSI, RAS,
944*4ec3ccb4SMadhukar Pappireddy   Fault handling, Performance Monitor Extensions, Event Handling, MPAM.
945*4ec3ccb4SMadhukar Pappireddy-  No support for independent peripheral devices.
946*4ec3ccb4SMadhukar Pappireddy
947fcb1398fSOlivier DeprezReferences
948fcb1398fSOlivier Deprez==========
949fcb1398fSOlivier Deprez
950fcb1398fSOlivier Deprez.. _[1]:
951fcb1398fSOlivier Deprez
952fcb1398fSOlivier Deprez[1] `Platform Security Architecture Firmware Framework for Arm® v8-A 1.0 Platform Design Document <https://developer.arm.com/docs/den0077/latest>`__
953fcb1398fSOlivier Deprez
954fcb1398fSOlivier Deprez.. _[2]:
955fcb1398fSOlivier Deprez
9566844c347SMadhukar Pappireddy[2] :ref:`Secure Partition Manager using MM interface<Secure Partition Manager (MM)>`
957fcb1398fSOlivier Deprez
958fcb1398fSOlivier Deprez.. _[3]:
959fcb1398fSOlivier Deprez
960fcb1398fSOlivier Deprez[3] `Trusted Boot Board Requirements
961fcb1398fSOlivier DeprezClient <https://developer.arm.com/docs/den0006/latest/trusted-board-boot-requirements-client-tbbr-client-armv8-a>`__
962fcb1398fSOlivier Deprez
963fcb1398fSOlivier Deprez.. _[4]:
964fcb1398fSOlivier Deprez
965fcb1398fSOlivier Deprez[4] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/lib/el3_runtime/aarch64/context.S#n45
966fcb1398fSOlivier Deprez
967fcb1398fSOlivier Deprez.. _[5]:
968fcb1398fSOlivier Deprez
969fcb1398fSOlivier Deprez[5] https://git.trustedfirmware.org/TF-A/tf-a-tests.git/tree/spm/cactus/cactus.dts
970fcb1398fSOlivier Deprez
971fcb1398fSOlivier Deprez.. _[6]:
972fcb1398fSOlivier Deprez
973fcb1398fSOlivier Deprez[6] https://trustedfirmware-a.readthedocs.io/en/latest/components/psa-ffa-manifest-binding.html
974fcb1398fSOlivier Deprez
975fcb1398fSOlivier Deprez.. _[7]:
976fcb1398fSOlivier Deprez
977fcb1398fSOlivier Deprez[7] https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/plat/arm/board/fvp/fdts/fvp_spmc_manifest.dts
978fcb1398fSOlivier Deprez
979fcb1398fSOlivier Deprez.. _[8]:
980fcb1398fSOlivier Deprez
981fcb1398fSOlivier Deprez[8] https://developer.trustedfirmware.org/w/tf_a/poc-multiple-signing-domains/
982fcb1398fSOlivier Deprez
983fcb1398fSOlivier Deprez--------------
984fcb1398fSOlivier Deprez
985fcb1398fSOlivier Deprez*Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.*
986