13cfa3497SZelalem Aweke 23cfa3497SZelalem AwekeRealm Management Extension (RME) 33cfa3497SZelalem Aweke==================================== 43cfa3497SZelalem Aweke 53cfa3497SZelalem AwekeFEAT_RME (or RME for short) is an Armv9-A extension and is one component of the 63cfa3497SZelalem Aweke`Arm Confidential Compute Architecture (Arm CCA)`_. TF-A supports RME starting 77446c266SZelalem Awekefrom version 2.6. This chapter discusses the changes to TF-A to support RME and 87446c266SZelalem Awekeprovides instructions on how to build and run TF-A with RME. 97446c266SZelalem Aweke 107446c266SZelalem AwekeRME support in TF-A 117446c266SZelalem Aweke--------------------- 127446c266SZelalem Aweke 137446c266SZelalem AwekeThe following diagram shows an Arm CCA software architecture with TF-A as the 147446c266SZelalem AwekeEL3 firmware. In the Arm CCA architecture there are two additional security 157446c266SZelalem Awekestates and address spaces: ``Root`` and ``Realm``. TF-A firmware runs in the 167446c266SZelalem AwekeRoot world. In the realm world, a Realm Management Monitor firmware (RMM) 177446c266SZelalem Awekemanages the execution of Realm VMs and their interaction with the hypervisor. 187446c266SZelalem Aweke 197446c266SZelalem Aweke.. image:: ../resources/diagrams/arm-cca-software-arch.png 207446c266SZelalem Aweke 217446c266SZelalem AwekeRME is the hardware extension to support Arm CCA. To support RME, various 227446c266SZelalem Awekechanges have been introduced to TF-A. We discuss those changes below. 237446c266SZelalem Aweke 247446c266SZelalem AwekeChanges to translation tables library 257446c266SZelalem Aweke*************************************** 267446c266SZelalem AwekeRME adds Root and Realm Physical address spaces. To support this, two new 277446c266SZelalem Awekememory type macros, ``MT_ROOT`` and ``MT_REALM``, have been added to the 287446c266SZelalem Aweke:ref:`Translation (XLAT) Tables Library`. These macros are used to configure 297446c266SZelalem Awekememory regions as Root or Realm respectively. 307446c266SZelalem Aweke 317446c266SZelalem Aweke.. note:: 327446c266SZelalem Aweke 337446c266SZelalem Aweke Only version 2 of the translation tables library supports the new memory 347446c266SZelalem Aweke types. 357446c266SZelalem Aweke 367446c266SZelalem AwekeChanges to context management 377446c266SZelalem Aweke******************************* 387446c266SZelalem AwekeA new CPU context for the Realm world has been added. The existing 397446c266SZelalem Aweke:ref:`CPU context management API<PSCI Library Integration guide for Armv8-A 407446c266SZelalem AwekeAArch32 systems>` can be used to manage Realm context. 417446c266SZelalem Aweke 427446c266SZelalem AwekeBoot flow changes 437446c266SZelalem Aweke******************* 447446c266SZelalem AwekeIn a typical TF-A boot flow, BL2 runs at Secure-EL1. However when RME is 457446c266SZelalem Awekeenabled, TF-A runs in the Root world at EL3. Therefore, the boot flow is 467446c266SZelalem Awekemodified to run BL2 at EL3 when RME is enabled. In addition to this, a 477446c266SZelalem AwekeRealm-world firmware (RMM) is loaded by BL2 in the Realm physical address 487446c266SZelalem Awekespace. 497446c266SZelalem Aweke 507446c266SZelalem AwekeThe boot flow when RME is enabled looks like the following: 517446c266SZelalem Aweke 527446c266SZelalem Aweke1. BL1 loads and executes BL2 at EL3 537446c266SZelalem Aweke2. BL2 loads images including RMM 547446c266SZelalem Aweke3. BL2 transfers control to BL31 557446c266SZelalem Aweke4. BL31 initializes SPM (if SPM is enabled) 567446c266SZelalem Aweke5. BL31 initializes RMM 577446c266SZelalem Aweke6. BL31 transfers control to Normal-world software 587446c266SZelalem Aweke 597446c266SZelalem AwekeGranule Protection Tables (GPT) library 607446c266SZelalem Aweke***************************************** 617446c266SZelalem AwekeIsolation between the four physical address spaces is enforced by a process 627446c266SZelalem Awekecalled Granule Protection Check (GPC) performed by the MMU downstream any 637446c266SZelalem Awekeaddress translation. GPC makes use of Granule Protection Table (GPT) in the 647446c266SZelalem AwekeRoot world that describes the physical address space assignment of every 657446c266SZelalem Awekepage (granule). A GPT library that provides APIs to initialize GPTs and to 667446c266SZelalem Aweketransition granules between different physical address spaces has been added. 677446c266SZelalem AwekeMore information about the GPT library can be found in the 687446c266SZelalem Aweke:ref:`Granule Protection Tables Library` chapter. 697446c266SZelalem Aweke 707446c266SZelalem AwekeRMM Dispatcher (RMMD) 717446c266SZelalem Aweke************************ 727446c266SZelalem AwekeRMMD is a new standard runtime service that handles the switch to the Realm 737446c266SZelalem Awekeworld. It initializes the RMM and handles Realm Management Interface (RMI) 747446c266SZelalem AwekeSMC calls from Non-secure and Realm worlds. 757446c266SZelalem Aweke 7669447290SJavier Almansa SobrinoThere is a contract between RMM and RMMD that defines the arguments that the 7769447290SJavier Almansa Sobrinoformer needs to take in order to initialize and also the possible return values. 7869447290SJavier Almansa SobrinoThis contract is defined in the RMM Boot Interface, which can be found at 7969447290SJavier Almansa Sobrino:ref:`rmm_el3_boot_interface`. 8069447290SJavier Almansa Sobrino 8169447290SJavier Almansa SobrinoThere is also a specification of the runtime services provided by TF-A 8269447290SJavier Almansa Sobrinoto RMM. This can be found at :ref:`runtime_services_and_interface`. 8369447290SJavier Almansa Sobrino 847446c266SZelalem AwekeTest Realm Payload (TRP) 857446c266SZelalem Aweke************************* 867446c266SZelalem AwekeTRP is a small test payload that runs at R-EL2 and implements a subset of 877446c266SZelalem Awekethe Realm Management Interface (RMI) commands to primarily test EL3 firmware 887446c266SZelalem Awekeand the interface between R-EL2 and EL3. When building TF-A with RME enabled, 897446c266SZelalem Awekeif a path to an RMM image is not provided, TF-A builds the TRP by default 907446c266SZelalem Awekeand uses it as RMM image. 913cfa3497SZelalem Aweke 923cfa3497SZelalem AwekeBuilding and running TF-A with RME 933cfa3497SZelalem Aweke------------------------------------ 943cfa3497SZelalem Aweke 953cfa3497SZelalem AwekeThis section describes how you can build and run TF-A with RME enabled. 963cfa3497SZelalem AwekeWe assume you have all the :ref:`Prerequisites` to build TF-A. 973cfa3497SZelalem Aweke 983cfa3497SZelalem AwekeThe following instructions show you how to build and run TF-A with RME 9999d9ce8aSShruti Guptafor two scenarios: 1003cfa3497SZelalem Aweke 10199d9ce8aSShruti Gupta- Three-world execution: TF-A with TF-A Tests or Linux. 1023cfa3497SZelalem Aweke 10399d9ce8aSShruti Gupta - NS (TF-A Test or Linux), 10499d9ce8aSShruti Gupta - Root (TF-A) 10599d9ce8aSShruti Gupta - Realm (RMM or TRP) 10699d9ce8aSShruti Gupta 10799d9ce8aSShruti Gupta- Four-world execution: TF-A, Hafnium and TF-A Tests or Linux. 10899d9ce8aSShruti Gupta 10999d9ce8aSShruti Gupta - NS (TF-A Test or Linux), 11099d9ce8aSShruti Gupta - Root (TF-A) 11199d9ce8aSShruti Gupta - Realm (RMM or TRP) 11299d9ce8aSShruti Gupta - SPM (Hafnium) 1133cfa3497SZelalem Aweke 1147446c266SZelalem AwekeTo run the tests, you need an FVP model. Please use the :ref:`latest version 1157446c266SZelalem Aweke<Arm Fixed Virtual Platforms (FVP)>` of *FVP_Base_RevC-2xAEMvA* model. 1163cfa3497SZelalem Aweke 11799d9ce8aSShruti GuptaThree World Testing with TF-A Tests 11899d9ce8aSShruti Gupta************************************* 1193cfa3497SZelalem Aweke 12099d9ce8aSShruti Gupta**1. Obtain and build TF-A Tests with Realm Payload** 1213cfa3497SZelalem Aweke 12299d9ce8aSShruti GuptaThe full set of instructions to setup build host and build options for 12399d9ce8aSShruti GuptaTF-A-Tests can be found in the `TFTF Getting Started`_. 12499d9ce8aSShruti Gupta 1253cfa3497SZelalem AwekeUse the following instructions to build TF-A with `TF-A Tests`_ as the 1263cfa3497SZelalem Awekenon-secure payload (BL33). 1273cfa3497SZelalem Aweke 1283cfa3497SZelalem Aweke.. code:: shell 1293cfa3497SZelalem Aweke 1303cfa3497SZelalem Aweke git clone https://git.trustedfirmware.org/TF-A/tf-a-tests.git 1313cfa3497SZelalem Aweke cd tf-a-tests 13299d9ce8aSShruti Gupta make CROSS_COMPILE=aarch64-none-elf- PLAT=fvp DEBUG=1 all pack_realm 1333cfa3497SZelalem Aweke 13499d9ce8aSShruti GuptaThis produces a TF-A Tests binary (**tftf.bin**) with Realm payload packaged 13599d9ce8aSShruti Guptaand **sp_layout.json** in the **build/fvp/debug** directory. 1363cfa3497SZelalem Aweke 13799d9ce8aSShruti Gupta**2. Obtain and build RMM Image** 13899d9ce8aSShruti Gupta 13999d9ce8aSShruti GuptaPlease refer to the `RMM Getting Started`_ on how to setup 14099d9ce8aSShruti GuptaHost Environment and build RMM. 14199d9ce8aSShruti Gupta 14299d9ce8aSShruti GuptaThe below command shows how to build RMM using the default build options for FVP. 1433cfa3497SZelalem Aweke 1443cfa3497SZelalem Aweke.. code:: shell 1453cfa3497SZelalem Aweke 14699d9ce8aSShruti Gupta git clone --recursive https://git.trustedfirmware.org/TF-RMM/tf-rmm.git 14799d9ce8aSShruti Gupta cd tf-rmm 14899d9ce8aSShruti Gupta cmake -DRMM_CONFIG=fvp_defcfg -S . -B build 14999d9ce8aSShruti Gupta cmake --build build 15099d9ce8aSShruti Gupta 15199d9ce8aSShruti GuptaThis will generate **rmm.img** in **build** folder. 15299d9ce8aSShruti Gupta 15399d9ce8aSShruti Gupta**3. Build TF-A** 15499d9ce8aSShruti Gupta 15599d9ce8aSShruti GuptaThe `TF-A Getting Started`_ has the necessary instructions to setup Host 15699d9ce8aSShruti Guptamachine and build TF-A. 15799d9ce8aSShruti Gupta 15899d9ce8aSShruti GuptaTo build for RME, set ``ENABLE_RME`` build option to 1 and provide the path to 15999d9ce8aSShruti Guptathe RMM binary using the ``RMM`` build option. 16099d9ce8aSShruti GuptaCurrently, this feature is only supported for the FVP platform. 16199d9ce8aSShruti Gupta 16299d9ce8aSShruti Gupta.. note:: 16399d9ce8aSShruti Gupta 16499d9ce8aSShruti Gupta ENABLE_RME build option is currently experimental. 16599d9ce8aSShruti Gupta 16699d9ce8aSShruti GuptaIf the ``RMM`` option is not used, then the Test Realm Payload (TRP) in TF-A 16799d9ce8aSShruti Guptawill be built and used as the RMM. 16899d9ce8aSShruti Gupta 16999d9ce8aSShruti Gupta.. code:: shell 17099d9ce8aSShruti Gupta 17199d9ce8aSShruti Gupta git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git 1723cfa3497SZelalem Aweke cd trusted-firmware-a 1733cfa3497SZelalem Aweke make CROSS_COMPILE=aarch64-none-elf- \ 1743cfa3497SZelalem Aweke PLAT=fvp \ 1753cfa3497SZelalem Aweke ENABLE_RME=1 \ 17699d9ce8aSShruti Gupta RMM=<path/to/rmm.img> \ 1773cfa3497SZelalem Aweke FVP_HW_CONFIG_DTS=fdts/fvp-base-gicv3-psci-1t.dts \ 1783cfa3497SZelalem Aweke DEBUG=1 \ 1793cfa3497SZelalem Aweke BL33=<path/to/tftf.bin> \ 1803cfa3497SZelalem Aweke all fip 1813cfa3497SZelalem Aweke 18299d9ce8aSShruti GuptaThis produces **bl1.bin** and **fip.bin** binaries in the **build/fvp/debug** directory. 1833cfa3497SZelalem Aweke 18499d9ce8aSShruti GuptaRunning the tests for a 3 world FVP setup 18599d9ce8aSShruti Gupta^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1863cfa3497SZelalem Aweke 1873cfa3497SZelalem AwekeUse the following command to run the tests on FVP. TF-A Tests should boot 18899d9ce8aSShruti Guptaand run the default tests including Realm world tests. 1893cfa3497SZelalem Aweke 1903cfa3497SZelalem Aweke.. code:: shell 1913cfa3497SZelalem Aweke 1923cfa3497SZelalem Aweke FVP_Base_RevC-2xAEMvA \ 1933cfa3497SZelalem Aweke -C bp.refcounter.non_arch_start_at_default=1 \ 19499d9ce8aSShruti Gupta -C bp.secureflashloader.fname=<path/to/bl1.bin> \ 19599d9ce8aSShruti Gupta -C bp.flashloader0.fname=<path/to/fip.bin> \ 1963cfa3497SZelalem Aweke -C bp.refcounter.use_real_time=0 \ 1973cfa3497SZelalem Aweke -C bp.ve_sysregs.exit_on_shutdown=1 \ 1983cfa3497SZelalem Aweke -C cache_state_modelled=1 \ 199*346cfe2bSAlexeiFedorov -C bp.dram_size=4 \ 20099d9ce8aSShruti Gupta -C bp.secure_memory=1 \ 20199d9ce8aSShruti Gupta -C pci.pci_smmuv3.mmu.SMMU_ROOT_IDR0=3 \ 20299d9ce8aSShruti Gupta -C pci.pci_smmuv3.mmu.SMMU_ROOT_IIDR=0x43B \ 20399d9ce8aSShruti Gupta -C pci.pci_smmuv3.mmu.root_register_page_offset=0x20000 \ 2043cfa3497SZelalem Aweke -C cluster0.NUM_CORES=4 \ 2053cfa3497SZelalem Aweke -C cluster0.PA_SIZE=48 \ 2063cfa3497SZelalem Aweke -C cluster0.ecv_support_level=2 \ 2073cfa3497SZelalem Aweke -C cluster0.gicv3.cpuintf-mmap-access-level=2 \ 2083cfa3497SZelalem Aweke -C cluster0.gicv3.without-DS-support=1 \ 2093cfa3497SZelalem Aweke -C cluster0.gicv4.mask-virtual-interrupt=1 \ 2103cfa3497SZelalem Aweke -C cluster0.has_arm_v8-6=1 \ 2113cfa3497SZelalem Aweke -C cluster0.has_amu=1 \ 21299d9ce8aSShruti Gupta -C cluster0.has_branch_target_exception=1 \ 21399d9ce8aSShruti Gupta -C cluster0.rme_support_level=2 \ 21499d9ce8aSShruti Gupta -C cluster0.has_rndr=1 \ 2153cfa3497SZelalem Aweke -C cluster0.has_v8_7_pmu_extension=2 \ 2163cfa3497SZelalem Aweke -C cluster0.max_32bit_el=-1 \ 21799d9ce8aSShruti Gupta -C cluster0.stage12_tlb_size=1024 \ 21899d9ce8aSShruti Gupta -C cluster0.check_memory_attributes=0 \ 21999d9ce8aSShruti Gupta -C cluster0.ish_is_osh=1 \ 2203cfa3497SZelalem Aweke -C cluster0.restriction_on_speculative_execution=2 \ 2213cfa3497SZelalem Aweke -C cluster0.restriction_on_speculative_execution_aarch32=2 \ 2223cfa3497SZelalem Aweke -C cluster1.NUM_CORES=4 \ 2233cfa3497SZelalem Aweke -C cluster1.PA_SIZE=48 \ 2243cfa3497SZelalem Aweke -C cluster1.ecv_support_level=2 \ 2253cfa3497SZelalem Aweke -C cluster1.gicv3.cpuintf-mmap-access-level=2 \ 2263cfa3497SZelalem Aweke -C cluster1.gicv3.without-DS-support=1 \ 2273cfa3497SZelalem Aweke -C cluster1.gicv4.mask-virtual-interrupt=1 \ 2283cfa3497SZelalem Aweke -C cluster1.has_arm_v8-6=1 \ 2293cfa3497SZelalem Aweke -C cluster1.has_amu=1 \ 23099d9ce8aSShruti Gupta -C cluster1.has_branch_target_exception=1 \ 23199d9ce8aSShruti Gupta -C cluster1.rme_support_level=2 \ 23299d9ce8aSShruti Gupta -C cluster1.has_rndr=1 \ 2333cfa3497SZelalem Aweke -C cluster1.has_v8_7_pmu_extension=2 \ 2343cfa3497SZelalem Aweke -C cluster1.max_32bit_el=-1 \ 23599d9ce8aSShruti Gupta -C cluster1.stage12_tlb_size=1024 \ 23699d9ce8aSShruti Gupta -C cluster1.check_memory_attributes=0 \ 23799d9ce8aSShruti Gupta -C cluster1.ish_is_osh=1 \ 2383cfa3497SZelalem Aweke -C cluster1.restriction_on_speculative_execution=2 \ 2393cfa3497SZelalem Aweke -C cluster1.restriction_on_speculative_execution_aarch32=2 \ 2403cfa3497SZelalem Aweke -C pctl.startup=0.0.0.0 \ 24199d9ce8aSShruti Gupta -C bp.smsc_91c111.enabled=1 \ 24299d9ce8aSShruti Gupta -C bp.hostbridge.userNetworking=1 2433cfa3497SZelalem Aweke 2443cfa3497SZelalem AwekeThe bottom of the output from *uart0* should look something like the following. 2453cfa3497SZelalem Aweke 2463cfa3497SZelalem Aweke.. code-block:: shell 2473cfa3497SZelalem Aweke 2483cfa3497SZelalem Aweke ... 2493cfa3497SZelalem Aweke 2503cfa3497SZelalem Aweke > Test suite 'FF-A Interrupt' 2513cfa3497SZelalem Aweke Passed 2523cfa3497SZelalem Aweke > Test suite 'SMMUv3 tests' 2533cfa3497SZelalem Aweke Passed 2543cfa3497SZelalem Aweke > Test suite 'PMU Leakage' 2553cfa3497SZelalem Aweke Passed 2563cfa3497SZelalem Aweke > Test suite 'DebugFS' 2573cfa3497SZelalem Aweke Passed 25899d9ce8aSShruti Gupta > Test suite 'RMI and SPM tests' 25999d9ce8aSShruti Gupta Passed 26099d9ce8aSShruti Gupta > Test suite 'Realm payload at EL1' 2613cfa3497SZelalem Aweke Passed 2621dd4bafbSManish Pandey > Test suite 'Invalid memory access' 2631dd4bafbSManish Pandey Passed 2643cfa3497SZelalem Aweke ... 2653cfa3497SZelalem Aweke 26699d9ce8aSShruti GuptaBuilding TF-A with RME enabled Linux Kernel 26799d9ce8aSShruti Gupta^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 26899d9ce8aSShruti Gupta 26999d9ce8aSShruti GuptaIf an RME enabled Linux kernel and filesystem is available for testing, 27099d9ce8aSShruti Guptaand a suitable NS boot loader is not available, then this option can be used to 27199d9ce8aSShruti Guptalaunch kernel directly after BL31: 27299d9ce8aSShruti Gupta 27399d9ce8aSShruti Gupta.. code-block:: shell 27499d9ce8aSShruti Gupta 27599d9ce8aSShruti Gupta cd trusted-firmware-a 27699d9ce8aSShruti Gupta make CROSS_COMPILE=aarch64-none-elf- \ 27799d9ce8aSShruti Gupta PLAT=fvp \ 27899d9ce8aSShruti Gupta ENABLE_RME=1 \ 27999d9ce8aSShruti Gupta RMM=<path/to/rmm.img> \ 28099d9ce8aSShruti Gupta FVP_HW_CONFIG_DTS=fdts/fvp-base-gicv3-psci-1t.dts \ 28199d9ce8aSShruti Gupta DEBUG=1 \ 28299d9ce8aSShruti Gupta ARM_LINUX_KERNEL_AS_BL33=1 \ 28399d9ce8aSShruti Gupta PRELOADED_BL33_BASE=0x84000000 \ 28499d9ce8aSShruti Gupta all fip 28599d9ce8aSShruti Gupta 28699d9ce8aSShruti GuptaBoot and run the RME enabled Linux Kernel 28799d9ce8aSShruti Gupta^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 28899d9ce8aSShruti Gupta 28999d9ce8aSShruti GuptaUse the following additional arguments to boot the kernel on FVP. 29099d9ce8aSShruti Gupta 29199d9ce8aSShruti Gupta.. code-block:: shell 29299d9ce8aSShruti Gupta 29399d9ce8aSShruti Gupta --data cluster0.cpu0=<path_to_kernel_Image>@0x84000000 \ 29499d9ce8aSShruti Gupta -C bp.virtioblockdevice.image_path=<path_to_rootfs.ext4> 29599d9ce8aSShruti Gupta 29699d9ce8aSShruti Gupta.. tip:: 29799d9ce8aSShruti Gupta 29899d9ce8aSShruti Gupta Set the FVP option `cache_state_modelled=0` to run Linux based tests much faster. 29999d9ce8aSShruti Gupta 30099d9ce8aSShruti GuptaFour-world execution with Hafnium and TF-A Tests 30199d9ce8aSShruti Gupta************************************************* 30299d9ce8aSShruti Gupta 30399d9ce8aSShruti GuptaFour-world execution involves software components in each security state: root, 30499d9ce8aSShruti Guptasecure, realm and non-secure. This section describes how to build TF-A 30599d9ce8aSShruti Guptawith four-world support. 30699d9ce8aSShruti Gupta 30799d9ce8aSShruti GuptaWe use TF-A as the root firmware, `Hafnium SPM`_ is the reference Secure world component 30899d9ce8aSShruti Guptaand the software components for the other 2 worlds (Realm and Non-Secure) 30999d9ce8aSShruti Guptaare as described in the previous section. 31099d9ce8aSShruti Gupta 31199d9ce8aSShruti Gupta**1. Obtain and build Hafnium** 31299d9ce8aSShruti Gupta 31399d9ce8aSShruti Gupta.. code:: shell 31499d9ce8aSShruti Gupta 31599d9ce8aSShruti Gupta git clone --recurse-submodules https://git.trustedfirmware.org/hafnium/hafnium.git 31699d9ce8aSShruti Gupta cd hafnium 31799d9ce8aSShruti Gupta # Use the default prebuilt LLVM/clang toolchain 31899d9ce8aSShruti Gupta PATH=$PWD/prebuilts/linux-x64/clang/bin:$PWD/prebuilts/linux-x64/dtc:$PATH 31999d9ce8aSShruti Gupta 32099d9ce8aSShruti GuptaFeature MTE needs to be disabled in Hafnium build, apply following patch to 32199d9ce8aSShruti Guptaproject/reference submodule 32299d9ce8aSShruti Gupta 32399d9ce8aSShruti Gupta.. code:: diff 32499d9ce8aSShruti Gupta 32599d9ce8aSShruti Gupta diff --git a/BUILD.gn b/BUILD.gn 32699d9ce8aSShruti Gupta index cc6a78f..234b20a 100644 32799d9ce8aSShruti Gupta --- a/BUILD.gn 32899d9ce8aSShruti Gupta +++ b/BUILD.gn 32999d9ce8aSShruti Gupta @@ -83,7 +83,6 @@ aarch64_toolchains("secure_aem_v8a_fvp") { 33099d9ce8aSShruti Gupta pl011_base_address = "0x1c090000" 33199d9ce8aSShruti Gupta smmu_base_address = "0x2b400000" 33299d9ce8aSShruti Gupta smmu_memory_size = "0x100000" 33399d9ce8aSShruti Gupta - enable_mte = "1" 33499d9ce8aSShruti Gupta plat_log_level = "LOG_LEVEL_INFO" 33599d9ce8aSShruti Gupta } 33699d9ce8aSShruti Gupta } 33799d9ce8aSShruti Gupta 33899d9ce8aSShruti Gupta.. code:: shell 33999d9ce8aSShruti Gupta 34099d9ce8aSShruti Gupta make PROJECT=reference 34199d9ce8aSShruti Gupta 34299d9ce8aSShruti GuptaThe Hafnium binary should be located at 34399d9ce8aSShruti Gupta*out/reference/secure_aem_v8a_fvp_clang/hafnium.bin* 34499d9ce8aSShruti Gupta 34599d9ce8aSShruti Gupta**2. Build TF-A** 34699d9ce8aSShruti Gupta 34799d9ce8aSShruti GuptaBuild TF-A with RME as well as SPM enabled. 34899d9ce8aSShruti Gupta 34999d9ce8aSShruti GuptaUse sp_layout.json previously generated in tf-a-test build. 35099d9ce8aSShruti Gupta 35199d9ce8aSShruti Gupta.. code:: shell 35299d9ce8aSShruti Gupta 35399d9ce8aSShruti Gupta make CROSS_COMPILE=aarch64-none-elf- \ 35499d9ce8aSShruti Gupta PLAT=fvp \ 35599d9ce8aSShruti Gupta ENABLE_RME=1 \ 35699d9ce8aSShruti Gupta FVP_HW_CONFIG_DTS=fdts/fvp-base-gicv3-psci-1t.dts \ 35799d9ce8aSShruti Gupta SPD=spmd \ 35899d9ce8aSShruti Gupta SPMD_SPM_AT_SEL2=1 \ 35999d9ce8aSShruti Gupta BRANCH_PROTECTION=1 \ 36099d9ce8aSShruti Gupta CTX_INCLUDE_PAUTH_REGS=1 \ 36199d9ce8aSShruti Gupta DEBUG=1 \ 36299d9ce8aSShruti Gupta SP_LAYOUT_FILE=<path/to/sp_layout.json> \ 36399d9ce8aSShruti Gupta BL32=<path/to/hafnium.bin> \ 36499d9ce8aSShruti Gupta BL33=<path/to/tftf.bin> \ 36599d9ce8aSShruti Gupta RMM=<path/to/rmm.img> \ 36699d9ce8aSShruti Gupta all fip 36799d9ce8aSShruti Gupta 36899d9ce8aSShruti GuptaRunning the tests for a 4 world FVP setup 36999d9ce8aSShruti Gupta^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 37099d9ce8aSShruti Gupta 37199d9ce8aSShruti GuptaUse the following arguments in addition to 37299d9ce8aSShruti Gupta`Running the tests for a 3 world FVP setup`_ to run tests for 4 world setup. 37399d9ce8aSShruti Gupta 37499d9ce8aSShruti Gupta.. code:: shell 37599d9ce8aSShruti Gupta 37699d9ce8aSShruti Gupta -C pci.pci_smmuv3.mmu.SMMU_AIDR=2 \ 37799d9ce8aSShruti Gupta -C pci.pci_smmuv3.mmu.SMMU_IDR0=0x0046123B \ 37899d9ce8aSShruti Gupta -C pci.pci_smmuv3.mmu.SMMU_IDR1=0x00600002 \ 37999d9ce8aSShruti Gupta -C pci.pci_smmuv3.mmu.SMMU_IDR3=0x1714 \ 38099d9ce8aSShruti Gupta -C pci.pci_smmuv3.mmu.SMMU_IDR5=0xFFFF0475 \ 38199d9ce8aSShruti Gupta -C pci.pci_smmuv3.mmu.SMMU_S_IDR1=0xA0000002 \ 38299d9ce8aSShruti Gupta -C pci.pci_smmuv3.mmu.SMMU_S_IDR2=0 \ 38399d9ce8aSShruti Gupta -C pci.pci_smmuv3.mmu.SMMU_S_IDR3=0 3843cfa3497SZelalem Aweke 3853cfa3497SZelalem Aweke.. _Arm Confidential Compute Architecture (Arm CCA): https://www.arm.com/why-arm/architecture/security-features/arm-confidential-compute-architecture 3863cfa3497SZelalem Aweke.. _Arm Architecture Models website: https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms/arm-ecosystem-models 38799d9ce8aSShruti Gupta.. _TF-A Getting Started: https://trustedfirmware-a.readthedocs.io/en/latest/getting_started/index.html 3883cfa3497SZelalem Aweke.. _TF-A Tests: https://trustedfirmware-a-tests.readthedocs.io/en/latest 38999d9ce8aSShruti Gupta.. _TFTF Getting Started: https://trustedfirmware-a-tests.readthedocs.io/en/latest/getting_started/index.html 39099d9ce8aSShruti Gupta.. _Hafnium SPM: https://www.trustedfirmware.org/projects/hafnium 39199d9ce8aSShruti Gupta.. _RMM Getting Started: https://git.trustedfirmware.org/TF-RMM/tf-rmm.git/tree/docs/getting_started/index.rst 392