xref: /arm-trusted-firmware/docs/components/realm-management-extension.rst (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700Schasinglulu
2*91f16700SchasingluluRealm Management Extension (RME)
3*91f16700Schasinglulu====================================
4*91f16700Schasinglulu
5*91f16700SchasingluluFEAT_RME (or RME for short) is an Armv9-A extension and is one component of the
6*91f16700Schasinglulu`Arm Confidential Compute Architecture (Arm CCA)`_. TF-A supports RME starting
7*91f16700Schasinglulufrom version 2.6. This chapter discusses the changes to TF-A to support RME and
8*91f16700Schasingluluprovides instructions on how to build and run TF-A with RME.
9*91f16700Schasinglulu
10*91f16700SchasingluluRME support in TF-A
11*91f16700Schasinglulu---------------------
12*91f16700Schasinglulu
13*91f16700SchasingluluThe following diagram shows an Arm CCA software architecture with TF-A as the
14*91f16700SchasingluluEL3 firmware. In the Arm CCA architecture there are two additional security
15*91f16700Schasinglulustates and address spaces: ``Root`` and ``Realm``. TF-A firmware runs in the
16*91f16700SchasingluluRoot world. In the realm world, a Realm Management Monitor firmware (`RMM`_)
17*91f16700Schasinglulumanages the execution of Realm VMs and their interaction with the hypervisor.
18*91f16700Schasinglulu
19*91f16700Schasinglulu.. image:: ../resources/diagrams/arm-cca-software-arch.png
20*91f16700Schasinglulu
21*91f16700SchasingluluRME is the hardware extension to support Arm CCA. To support RME, various
22*91f16700Schasingluluchanges have been introduced to TF-A. We discuss those changes below.
23*91f16700Schasinglulu
24*91f16700SchasingluluChanges to translation tables library
25*91f16700Schasinglulu***************************************
26*91f16700SchasingluluRME adds Root and Realm Physical address spaces. To support this, two new
27*91f16700Schasinglulumemory type macros, ``MT_ROOT`` and ``MT_REALM``, have been added to the
28*91f16700Schasinglulu:ref:`Translation (XLAT) Tables Library`. These macros are used to configure
29*91f16700Schasinglulumemory regions as Root or Realm respectively.
30*91f16700Schasinglulu
31*91f16700Schasinglulu.. note::
32*91f16700Schasinglulu
33*91f16700Schasinglulu Only version 2 of the translation tables library supports the new memory
34*91f16700Schasinglulu types.
35*91f16700Schasinglulu
36*91f16700SchasingluluChanges to context management
37*91f16700Schasinglulu*******************************
38*91f16700SchasingluluA new CPU context for the Realm world has been added. The existing
39*91f16700Schasinglulu:ref:`CPU context management API<PSCI Library Integration guide for Armv8-A
40*91f16700SchasingluluAArch32 systems>` can be used to manage Realm context.
41*91f16700Schasinglulu
42*91f16700SchasingluluBoot flow changes
43*91f16700Schasinglulu*******************
44*91f16700SchasingluluIn a typical TF-A boot flow, BL2 runs at Secure-EL1. However when RME is
45*91f16700Schasingluluenabled, TF-A runs in the Root world at EL3. Therefore, the boot flow is
46*91f16700Schasinglulumodified to run BL2 at EL3 when RME is enabled. In addition to this, a
47*91f16700SchasingluluRealm-world firmware (`RMM`_) is loaded by BL2 in the Realm physical address
48*91f16700Schasingluluspace.
49*91f16700Schasinglulu
50*91f16700SchasingluluThe boot flow when RME is enabled looks like the following:
51*91f16700Schasinglulu
52*91f16700Schasinglulu1. BL1 loads and executes BL2 at EL3
53*91f16700Schasinglulu2. BL2 loads images including RMM
54*91f16700Schasinglulu3. BL2 transfers control to BL31
55*91f16700Schasinglulu4. BL31 initializes SPM (if SPM is enabled)
56*91f16700Schasinglulu5. BL31 initializes RMM
57*91f16700Schasinglulu6. BL31 transfers control to Normal-world software
58*91f16700Schasinglulu
59*91f16700SchasingluluGranule Protection Tables (GPT) library
60*91f16700Schasinglulu*****************************************
61*91f16700SchasingluluIsolation between the four physical address spaces is enforced by a process
62*91f16700Schasinglulucalled Granule Protection Check (GPC) performed by the MMU downstream any
63*91f16700Schasingluluaddress translation. GPC makes use of Granule Protection Table (GPT) in the
64*91f16700SchasingluluRoot world that describes the physical address space assignment of every
65*91f16700Schasinglulupage (granule). A GPT library that provides APIs to initialize GPTs and to
66*91f16700Schasinglulutransition granules between different physical address spaces has been added.
67*91f16700SchasingluluMore information about the GPT library can be found in the
68*91f16700Schasinglulu:ref:`Granule Protection Tables Library` chapter.
69*91f16700Schasinglulu
70*91f16700SchasingluluRMM Dispatcher (RMMD)
71*91f16700Schasinglulu************************
72*91f16700SchasingluluRMMD is a new standard runtime service that handles the switch to the Realm
73*91f16700Schasingluluworld. It initializes the `RMM`_ and handles Realm Management Interface (RMI)
74*91f16700SchasingluluSMC calls from Non-secure.
75*91f16700Schasinglulu
76*91f16700SchasingluluThere is a contract between `RMM`_ and RMMD that defines the arguments that the
77*91f16700Schasingluluformer needs to take in order to initialize and also the possible return values.
78*91f16700SchasingluluThis contract is defined in the `RMM`_ Boot Interface, which can be found at
79*91f16700Schasinglulu:ref:`rmm_el3_boot_interface`.
80*91f16700Schasinglulu
81*91f16700SchasingluluThere is also a specification of the runtime services provided by TF-A
82*91f16700Schasingluluto `RMM`_. This can be found at :ref:`runtime_services_and_interface`.
83*91f16700Schasinglulu
84*91f16700SchasingluluTest Realm Payload (TRP)
85*91f16700Schasinglulu*************************
86*91f16700SchasingluluTRP is a small test payload that runs at R-EL2 and implements a subset of
87*91f16700Schasingluluthe Realm Management Interface (RMI) commands to primarily test EL3 firmware
88*91f16700Schasingluluand the interface between R-EL2 and EL3. When building TF-A with RME enabled,
89*91f16700Schasingluluif the path to an RMM image is not provided, TF-A builds the TRP by default
90*91f16700Schasingluluand uses it as the R-EL2 payload.
91*91f16700Schasinglulu
92*91f16700SchasingluluBuilding and running TF-A with RME
93*91f16700Schasinglulu----------------------------------
94*91f16700Schasinglulu
95*91f16700SchasingluluThis section describes how you can build and run TF-A with RME enabled.
96*91f16700SchasingluluWe assume you have read the :ref:`Prerequisites` to build TF-A.
97*91f16700Schasinglulu
98*91f16700SchasingluluThe following instructions show you how to build and run TF-A with RME
99*91f16700Schasingluluon FVP for two scenarios:
100*91f16700Schasinglulu
101*91f16700Schasinglulu- Three-world execution:  This is the configuration to use if Secure
102*91f16700Schasinglulu  world functionality is not needed. TF-A is tested with the following
103*91f16700Schasinglulu  software entities in each world as listed below:
104*91f16700Schasinglulu
105*91f16700Schasinglulu  - NS Host (RME capable Linux or TF-A Tests),
106*91f16700Schasinglulu  - Root (TF-A)
107*91f16700Schasinglulu  - R-EL2 (`RMM`_ or TRP)
108*91f16700Schasinglulu
109*91f16700Schasinglulu- Four-world execution: This is the configuration to use if both Secure
110*91f16700Schasinglulu  and Realm world functionality is needed. TF-A is tested with the following
111*91f16700Schasinglulu  software entities in each world as listed below:
112*91f16700Schasinglulu
113*91f16700Schasinglulu  - NS Host (RME capable Linux or TF-A Tests),
114*91f16700Schasinglulu  - Root (TF-A)
115*91f16700Schasinglulu  - R-EL2 (`RMM`_ or TRP)
116*91f16700Schasinglulu  - S-EL2 (Hafnium SPM)
117*91f16700Schasinglulu
118*91f16700SchasingluluTo run the tests, you need an FVP model. Please use the :ref:`latest version
119*91f16700Schasinglulu<Arm Fixed Virtual Platforms (FVP)>` of *FVP_Base_RevC-2xAEMvA* model. If NS
120*91f16700SchasingluluHost is Linux, then the below instructions assume that a suitable RME enabled
121*91f16700Schasinglulukernel image and associated root filesystem are available.
122*91f16700Schasinglulu
123*91f16700SchasingluluThree-world execution
124*91f16700Schasinglulu*********************
125*91f16700Schasinglulu
126*91f16700Schasinglulu**1. Clone and build RMM Image**
127*91f16700Schasinglulu
128*91f16700SchasingluluPlease refer to the `RMM Getting Started`_ on how to setup
129*91f16700SchasingluluHost Environment and build `RMM`_. The build commands assume that
130*91f16700Schasingluluan AArch64 toolchain and CMake executable are available in the
131*91f16700Schasinglulushell PATH variable and CROSS_COMPILE variable has been setup
132*91f16700Schasingluluappropriately.
133*91f16700Schasinglulu
134*91f16700SchasingluluTo clone `RMM`_ and build using the default build options for FVP:
135*91f16700Schasinglulu
136*91f16700Schasinglulu.. code:: shell
137*91f16700Schasinglulu
138*91f16700Schasinglulu git clone --recursive https://git.trustedfirmware.org/TF-RMM/tf-rmm.git
139*91f16700Schasinglulu cd tf-rmm
140*91f16700Schasinglulu cmake -DRMM_CONFIG=fvp_defcfg -S . -B build
141*91f16700Schasinglulu cmake --build build
142*91f16700Schasinglulu
143*91f16700SchasingluluThis will generate **rmm.img** in **build/Release** folder.
144*91f16700Schasinglulu
145*91f16700Schasinglulu**2. Clone and build TF-A Tests with Realm Payload**
146*91f16700Schasinglulu
147*91f16700SchasingluluThis step is only needed if NS Host is TF-A Tests. The full set
148*91f16700Schasingluluof instructions to setup build host and build options for
149*91f16700SchasingluluTF-A-Tests can be found in the `TFTF Getting Started`_. TF-A Tests
150*91f16700Schasinglulucan test Realm world with either `RMM`_ or TRP in R-EL2. In the TRP case,
151*91f16700Schasinglulusome tests which are not applicable will be skipped.
152*91f16700Schasinglulu
153*91f16700SchasingluluUse the following instructions to build TF-A with `TF-A Tests`_ as the
154*91f16700Schasinglulunon-secure payload (BL33).
155*91f16700Schasinglulu
156*91f16700Schasinglulu.. code:: shell
157*91f16700Schasinglulu
158*91f16700Schasinglulu git clone https://git.trustedfirmware.org/TF-A/tf-a-tests.git
159*91f16700Schasinglulu cd tf-a-tests
160*91f16700Schasinglulu make CROSS_COMPILE=aarch64-none-elf- PLAT=fvp DEBUG=1 ENABLE_REALM_PAYLOAD_TESTS=1 all
161*91f16700Schasinglulu
162*91f16700SchasingluluThis produces a TF-A Tests binary (**tftf.bin**) with Realm payload packaged
163*91f16700Schasingluluand **sp_layout.json** in the **build/fvp/debug** directory.
164*91f16700Schasinglulu
165*91f16700Schasinglulu
166*91f16700Schasinglulu**3. Build RME Enabled TF-A**
167*91f16700Schasinglulu
168*91f16700SchasingluluThe `TF-A Getting Started`_ has the necessary instructions to setup Host
169*91f16700Schasinglulumachine and build TF-A.
170*91f16700Schasinglulu
171*91f16700SchasingluluTo build for RME, set ``ENABLE_RME`` build option to 1 and provide the path to
172*91f16700Schasingluluthe `RMM`_ binary ``rmm.img`` using ``RMM`` build option.
173*91f16700Schasinglulu
174*91f16700Schasinglulu.. note::
175*91f16700Schasinglulu
176*91f16700Schasinglulu ENABLE_RME build option is currently experimental.
177*91f16700Schasinglulu
178*91f16700Schasinglulu.. note::
179*91f16700Schasinglulu
180*91f16700Schasinglulu If the ``RMM`` option is not specified, TF-A builds the TRP to load and
181*91f16700Schasinglulu run at R-EL2.
182*91f16700Schasinglulu
183*91f16700Schasinglulu.. code:: shell
184*91f16700Schasinglulu
185*91f16700Schasinglulu git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
186*91f16700Schasinglulu cd trusted-firmware-a
187*91f16700Schasinglulu make CROSS_COMPILE=aarch64-none-elf- \
188*91f16700Schasinglulu PLAT=fvp \
189*91f16700Schasinglulu ENABLE_RME=1 \
190*91f16700Schasinglulu RMM=<path/to/rmm.img> \
191*91f16700Schasinglulu FVP_HW_CONFIG_DTS=fdts/fvp-base-gicv3-psci-1t.dts \
192*91f16700Schasinglulu DEBUG=1 \
193*91f16700Schasinglulu BL33=<path/to/bl33> \
194*91f16700Schasinglulu all fip
195*91f16700Schasinglulu
196*91f16700Schasinglulu``BL33`` can point to a Non Secure Bootloader like UEFI/U-Boot or
197*91f16700Schasingluluthe TF-A Tests binary(**tftf.bin**) from the previous step.
198*91f16700Schasinglulu
199*91f16700SchasingluluThis produces **bl1.bin** and **fip.bin** binaries in the **build/fvp/debug**
200*91f16700Schasingluludirectory.
201*91f16700Schasinglulu
202*91f16700SchasingluluTF-A can also directly boot Linux kernel on the FVP. The kernel needs to be
203*91f16700Schasinglulu`preloaded` to a suitable memory location and this needs to be specified via
204*91f16700Schasinglulu``PRELOADED_BL33_BASE`` build option. Also TF-A should implement the Linux
205*91f16700Schasinglulukernel register conventions for boot and this can be set using the
206*91f16700Schasinglulu``ARM_LINUX_KERNEL_AS_BL33`` option.
207*91f16700Schasinglulu
208*91f16700Schasinglulu.. code-block:: shell
209*91f16700Schasinglulu
210*91f16700Schasinglulu cd trusted-firmware-a
211*91f16700Schasinglulu make CROSS_COMPILE=aarch64-none-elf- \
212*91f16700Schasinglulu PLAT=fvp \
213*91f16700Schasinglulu ENABLE_RME=1 \
214*91f16700Schasinglulu RMM=<path/to/rmm.img> \
215*91f16700Schasinglulu FVP_HW_CONFIG_DTS=fdts/fvp-base-gicv3-psci-1t.dts \
216*91f16700Schasinglulu DEBUG=1 \
217*91f16700Schasinglulu ARM_LINUX_KERNEL_AS_BL33=1 \
218*91f16700Schasinglulu PRELOADED_BL33_BASE=0x84000000 \
219*91f16700Schasinglulu all fip
220*91f16700Schasinglulu
221*91f16700SchasingluluThe above command assumes that the Linux kernel will be placed in FVP
222*91f16700Schasinglulumemory at 0x84000000 via suitable FVP option (see the next step).
223*91f16700Schasinglulu
224*91f16700Schasinglulu.. _fvp_3_world_cmd:
225*91f16700Schasinglulu
226*91f16700Schasinglulu**4. Running FVP for 3 world setup**
227*91f16700Schasinglulu
228*91f16700SchasingluluUse the following command to run the tests on FVP.
229*91f16700Schasinglulu
230*91f16700Schasinglulu.. code:: shell
231*91f16700Schasinglulu
232*91f16700Schasinglulu FVP_Base_RevC-2xAEMvA                                          \
233*91f16700Schasinglulu -C bp.refcounter.non_arch_start_at_default=1                   \
234*91f16700Schasinglulu -C bp.secureflashloader.fname=<path/to/bl1.bin>                \
235*91f16700Schasinglulu -C bp.flashloader0.fname=<path/to/fip.bin>                     \
236*91f16700Schasinglulu -C bp.refcounter.use_real_time=0                               \
237*91f16700Schasinglulu -C bp.ve_sysregs.exit_on_shutdown=1                            \
238*91f16700Schasinglulu -C cache_state_modelled=1                                      \
239*91f16700Schasinglulu -C bp.dram_size=4                                              \
240*91f16700Schasinglulu -C bp.secure_memory=1                                          \
241*91f16700Schasinglulu -C pci.pci_smmuv3.mmu.SMMU_ROOT_IDR0=3                         \
242*91f16700Schasinglulu -C pci.pci_smmuv3.mmu.SMMU_ROOT_IIDR=0x43B                     \
243*91f16700Schasinglulu -C pci.pci_smmuv3.mmu.root_register_page_offset=0x20000        \
244*91f16700Schasinglulu -C cluster0.NUM_CORES=4                                        \
245*91f16700Schasinglulu -C cluster0.PA_SIZE=48                                         \
246*91f16700Schasinglulu -C cluster0.ecv_support_level=2                                \
247*91f16700Schasinglulu -C cluster0.gicv3.cpuintf-mmap-access-level=2                  \
248*91f16700Schasinglulu -C cluster0.gicv3.without-DS-support=1                         \
249*91f16700Schasinglulu -C cluster0.gicv4.mask-virtual-interrupt=1                     \
250*91f16700Schasinglulu -C cluster0.has_arm_v8-6=1                                     \
251*91f16700Schasinglulu -C cluster0.has_amu=1                                          \
252*91f16700Schasinglulu -C cluster0.has_branch_target_exception=1                      \
253*91f16700Schasinglulu -C cluster0.rme_support_level=2                                \
254*91f16700Schasinglulu -C cluster0.has_rndr=1                                         \
255*91f16700Schasinglulu -C cluster0.has_v8_7_pmu_extension=2                           \
256*91f16700Schasinglulu -C cluster0.max_32bit_el=-1                                    \
257*91f16700Schasinglulu -C cluster0.stage12_tlb_size=1024                              \
258*91f16700Schasinglulu -C cluster0.check_memory_attributes=0                          \
259*91f16700Schasinglulu -C cluster0.ish_is_osh=1                                       \
260*91f16700Schasinglulu -C cluster0.restriction_on_speculative_execution=2             \
261*91f16700Schasinglulu -C cluster0.restriction_on_speculative_execution_aarch32=2     \
262*91f16700Schasinglulu -C cluster1.NUM_CORES=4                                        \
263*91f16700Schasinglulu -C cluster1.PA_SIZE=48                                         \
264*91f16700Schasinglulu -C cluster1.ecv_support_level=2                                \
265*91f16700Schasinglulu -C cluster1.gicv3.cpuintf-mmap-access-level=2                  \
266*91f16700Schasinglulu -C cluster1.gicv3.without-DS-support=1                         \
267*91f16700Schasinglulu -C cluster1.gicv4.mask-virtual-interrupt=1                     \
268*91f16700Schasinglulu -C cluster1.has_arm_v8-6=1                                     \
269*91f16700Schasinglulu -C cluster1.has_amu=1                                          \
270*91f16700Schasinglulu -C cluster1.has_branch_target_exception=1                      \
271*91f16700Schasinglulu -C cluster1.rme_support_level=2                                \
272*91f16700Schasinglulu -C cluster1.has_rndr=1                                         \
273*91f16700Schasinglulu -C cluster1.has_v8_7_pmu_extension=2                           \
274*91f16700Schasinglulu -C cluster1.max_32bit_el=-1                                    \
275*91f16700Schasinglulu -C cluster1.stage12_tlb_size=1024                              \
276*91f16700Schasinglulu -C cluster1.check_memory_attributes=0                          \
277*91f16700Schasinglulu -C cluster1.ish_is_osh=1                                       \
278*91f16700Schasinglulu -C cluster1.restriction_on_speculative_execution=2             \
279*91f16700Schasinglulu -C cluster1.restriction_on_speculative_execution_aarch32=2     \
280*91f16700Schasinglulu -C pctl.startup=0.0.0.0                                        \
281*91f16700Schasinglulu -C bp.smsc_91c111.enabled=1                                    \
282*91f16700Schasinglulu -C bp.hostbridge.userNetworking=1                              \
283*91f16700Schasinglulu -C bp.virtioblockdevice.image_path=<path/to/rootfs.ext4>
284*91f16700Schasinglulu
285*91f16700SchasingluluThe ``bp.virtioblockdevice.image_path`` option presents the rootfs as a
286*91f16700Schasingluluvirtio block device to Linux kernel. It can be ignored if NS Host is
287*91f16700SchasingluluTF-A-Tests or rootfs is accessed by some other mechanism.
288*91f16700Schasinglulu
289*91f16700SchasingluluIf TF-A was built to expect a preloaded Linux kernel, then use the following
290*91f16700SchasingluluFVP argument to load the kernel image at the expected address.
291*91f16700Schasinglulu
292*91f16700Schasinglulu.. code-block:: shell
293*91f16700Schasinglulu
294*91f16700Schasinglulu --data cluster0.cpu0=<path_to_kernel_Image>@0x84000000         \
295*91f16700Schasinglulu
296*91f16700Schasinglulu
297*91f16700Schasinglulu.. tip::
298*91f16700Schasinglulu Tips to boot and run Linux faster on the FVP :
299*91f16700Schasinglulu  1. Set the FVP option ``cache_state_modelled`` to 0.
300*91f16700Schasinglulu  2. Disable the CPU Idle driver in Linux either by setting the kernel command line
301*91f16700Schasinglulu     parameter "cpuidle.off=1" or by disabling the ``CONFIG_CPU_IDLE`` kernel config.
302*91f16700Schasinglulu
303*91f16700SchasingluluIf the NS Host is TF-A-Tests, then the default test suite in TFTF
304*91f16700Schasingluluwill execute on the FVP and this includes Realm world tests. The
305*91f16700Schasinglulutail of the output from *uart0* should look something like the following.
306*91f16700Schasinglulu
307*91f16700Schasinglulu.. code-block:: shell
308*91f16700Schasinglulu
309*91f16700Schasinglulu ...
310*91f16700Schasinglulu
311*91f16700Schasinglulu > Test suite 'FF-A Interrupt'
312*91f16700Schasinglulu                                                                Passed
313*91f16700Schasinglulu > Test suite 'SMMUv3 tests'
314*91f16700Schasinglulu                                                                Passed
315*91f16700Schasinglulu > Test suite 'PMU Leakage'
316*91f16700Schasinglulu                                                                Passed
317*91f16700Schasinglulu > Test suite 'DebugFS'
318*91f16700Schasinglulu                                                                Passed
319*91f16700Schasinglulu > Test suite 'RMI and SPM tests'
320*91f16700Schasinglulu                                                                Passed
321*91f16700Schasinglulu > Test suite 'Realm payload at EL1'
322*91f16700Schasinglulu                                                                Passed
323*91f16700Schasinglulu > Test suite 'Invalid memory access'
324*91f16700Schasinglulu                                                                Passed
325*91f16700Schasinglulu ...
326*91f16700Schasinglulu
327*91f16700SchasingluluFour-world execution
328*91f16700Schasinglulu********************
329*91f16700Schasinglulu
330*91f16700SchasingluluFour-world execution involves software components in each security state: root,
331*91f16700Schasinglulusecure, realm and non-secure. This section describes how to build TF-A
332*91f16700Schasingluluwith four-world support.
333*91f16700Schasinglulu
334*91f16700SchasingluluWe use TF-A as the root firmware, `Hafnium SPM`_ is the reference Secure world
335*91f16700Schasinglulucomponent running at S-EL2. `RMM`_ can be built as described in previous
336*91f16700Schasinglulusection. The examples below assume TF-A-Tests as the NS Host and utilize SPs
337*91f16700Schasinglulufrom TF-A-Tests.
338*91f16700Schasinglulu
339*91f16700Schasinglulu**1. Obtain and build Hafnium SPM**
340*91f16700Schasinglulu
341*91f16700Schasinglulu.. code:: shell
342*91f16700Schasinglulu
343*91f16700Schasinglulu git clone --recurse-submodules https://git.trustedfirmware.org/hafnium/hafnium.git
344*91f16700Schasinglulu cd hafnium
345*91f16700Schasinglulu #  Use the default prebuilt LLVM/clang toolchain
346*91f16700Schasinglulu PATH=$PWD/prebuilts/linux-x64/clang/bin:$PWD/prebuilts/linux-x64/dtc:$PATH
347*91f16700Schasinglulu
348*91f16700SchasingluluFeature MTE needs to be disabled in Hafnium build, apply following patch to
349*91f16700Schasingluluproject/reference submodule
350*91f16700Schasinglulu
351*91f16700Schasinglulu.. code:: diff
352*91f16700Schasinglulu
353*91f16700Schasinglulu diff --git a/BUILD.gn b/BUILD.gn
354*91f16700Schasinglulu index cc6a78f..234b20a 100644
355*91f16700Schasinglulu --- a/BUILD.gn
356*91f16700Schasinglulu +++ b/BUILD.gn
357*91f16700Schasinglulu @@ -83,7 +83,6 @@ aarch64_toolchains("secure_aem_v8a_fvp") {
358*91f16700Schasinglulu     pl011_base_address = "0x1c090000"
359*91f16700Schasinglulu     smmu_base_address = "0x2b400000"
360*91f16700Schasinglulu     smmu_memory_size = "0x100000"
361*91f16700Schasinglulu -    enable_mte = "1"
362*91f16700Schasinglulu     plat_log_level = "LOG_LEVEL_INFO"
363*91f16700Schasinglulu   }
364*91f16700Schasinglulu }
365*91f16700Schasinglulu
366*91f16700Schasinglulu.. code:: shell
367*91f16700Schasinglulu
368*91f16700Schasinglulu make PROJECT=reference
369*91f16700Schasinglulu
370*91f16700SchasingluluThe Hafnium binary should be located at
371*91f16700Schasinglulu*out/reference/secure_aem_v8a_fvp_clang/hafnium.bin*
372*91f16700Schasinglulu
373*91f16700Schasinglulu**2. Build RME enabled TF-A with SPM**
374*91f16700Schasinglulu
375*91f16700SchasingluluBuild TF-A with RME as well as SPM enabled.
376*91f16700Schasinglulu
377*91f16700SchasingluluUse the ``sp_layout.json`` previously generated in TF-A Tests
378*91f16700Schasinglulubuild to run SP tests.
379*91f16700Schasinglulu
380*91f16700Schasinglulu.. code:: shell
381*91f16700Schasinglulu
382*91f16700Schasinglulu make CROSS_COMPILE=aarch64-none-elf- \
383*91f16700Schasinglulu PLAT=fvp \
384*91f16700Schasinglulu ENABLE_RME=1 \
385*91f16700Schasinglulu FVP_HW_CONFIG_DTS=fdts/fvp-base-gicv3-psci-1t.dts \
386*91f16700Schasinglulu SPD=spmd \
387*91f16700Schasinglulu BRANCH_PROTECTION=1 \
388*91f16700Schasinglulu CTX_INCLUDE_PAUTH_REGS=1 \
389*91f16700Schasinglulu DEBUG=1 \
390*91f16700Schasinglulu SP_LAYOUT_FILE=<path/to/sp_layout.json> \
391*91f16700Schasinglulu BL32=<path/to/hafnium.bin> \
392*91f16700Schasinglulu BL33=<path/to/tftf.bin> \
393*91f16700Schasinglulu RMM=<path/to/rmm.img> \
394*91f16700Schasinglulu all fip
395*91f16700Schasinglulu
396*91f16700Schasinglulu**3. Running the FVP for a 4 world setup**
397*91f16700Schasinglulu
398*91f16700SchasingluluUse the following arguments in addition to the FVP options mentioned in
399*91f16700Schasinglulu:ref:`4. Running FVP for 3 world setup <fvp_3_world_cmd>` to run tests for
400*91f16700Schasinglulu4 world setup.
401*91f16700Schasinglulu
402*91f16700Schasinglulu.. code:: shell
403*91f16700Schasinglulu
404*91f16700Schasinglulu -C pci.pci_smmuv3.mmu.SMMU_AIDR=2              \
405*91f16700Schasinglulu -C pci.pci_smmuv3.mmu.SMMU_IDR0=0x0046123B     \
406*91f16700Schasinglulu -C pci.pci_smmuv3.mmu.SMMU_IDR1=0x00600002     \
407*91f16700Schasinglulu -C pci.pci_smmuv3.mmu.SMMU_IDR3=0x1714         \
408*91f16700Schasinglulu -C pci.pci_smmuv3.mmu.SMMU_IDR5=0xFFFF0475     \
409*91f16700Schasinglulu -C pci.pci_smmuv3.mmu.SMMU_S_IDR1=0xA0000002   \
410*91f16700Schasinglulu -C pci.pci_smmuv3.mmu.SMMU_S_IDR2=0            \
411*91f16700Schasinglulu -C pci.pci_smmuv3.mmu.SMMU_S_IDR3=0
412*91f16700Schasinglulu
413*91f16700Schasinglulu.. _Arm Confidential Compute Architecture (Arm CCA): https://www.arm.com/why-arm/architecture/security-features/arm-confidential-compute-architecture
414*91f16700Schasinglulu.. _Arm Architecture Models website: https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms/arm-ecosystem-models
415*91f16700Schasinglulu.. _TF-A Getting Started: https://trustedfirmware-a.readthedocs.io/en/latest/getting_started/index.html
416*91f16700Schasinglulu.. _TF-A Tests: https://trustedfirmware-a-tests.readthedocs.io/en/latest
417*91f16700Schasinglulu.. _TFTF Getting Started: https://trustedfirmware-a-tests.readthedocs.io/en/latest/getting_started/index.html
418*91f16700Schasinglulu.. _Hafnium SPM: https://www.trustedfirmware.org/projects/hafnium
419*91f16700Schasinglulu.. _RMM Getting Started: https://tf-rmm.readthedocs.io/en/latest/getting_started/index.html
420*91f16700Schasinglulu.. _RMM: https://www.trustedfirmware.org/projects/tf-rmm/
421