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