Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 1 | |
| 2 | .. section-numbering:: |
| 3 | :suffix: . |
| 4 | |
| 5 | .. contents:: |
| 6 | |
| 7 | Please note that the Trusted Firmware-A Tests version follows the Trusted |
| 8 | Firmware-A version for simplicity. At any point in time, TF-A Tests version |
| 9 | `x.y` aims at testing TF-A version `x.y`. Different versions of TF-A and TF-A |
| 10 | Tests are not guaranteed to be compatible. This also means that a version |
| 11 | upgrade on the TF-A-Tests side might not necessarily introduce any new feature. |
| 12 | |
| 13 | Trusted Firmware-A Tests - version 2.0 |
| 14 | ====================================== |
| 15 | |
| 16 | New features |
| 17 | ------------ |
| 18 | |
| 19 | This is the first public release of the Trusted Firmware-A Tests source code. |
| 20 | |
| 21 | TFTF |
| 22 | ```` |
| 23 | |
| 24 | - Provides a baremetal test framework to exercise TF-A features through its |
| 25 | ``SMC`` interface. |
| 26 | |
| 27 | - Integrates easily with TF-A: the TFTF binary is packaged in the FIP image |
| 28 | as a ``BL33`` component. |
| 29 | |
| 30 | - Standalone binary that runs on the target without human intervention (except |
| 31 | for some specific tests that require a manual target reset). |
| 32 | |
| 33 | - Designed for multi-core testing. The various sub-frameworks allow maximum |
| 34 | parallelism in order to stress the firmware. |
| 35 | |
| 36 | - Displays test results on the UART output. This may then be parsed by an |
| 37 | external tool and integrated in a continuous integration system. |
| 38 | |
| 39 | - Supports running in AArch64 (NS-EL2 or NS-EL1) and AArch32 states. |
| 40 | |
| 41 | - Supports parsing a tests manifest (XML file) listing the tests to include in |
| 42 | the binary. |
| 43 | |
| 44 | - Detects most platform features at run time (e.g. topology, GIC version, ...). |
| 45 | |
| 46 | - Provides a topology enumeration framework. Allows tests to easily go through |
| 47 | affinity levels and power domain nodes. |
| 48 | |
| 49 | - Provides an event framework to synchronize CPU operations in a multi-core |
| 50 | context. |
| 51 | |
| 52 | - Provides a timer framework. Relies on a single global timer to generate |
| 53 | interrupts for all CPUs in the system. This allows tests to easily program |
| 54 | interrupts on demand to use as a wake-up event source to come out of CPU |
| 55 | suspend state for example. |
| 56 | |
| 57 | - Provides a power-state enumeration framework. Abstracts the valid power |
| 58 | states supported on the platform. |
| 59 | |
| 60 | - Provides helper functions for power management operations (CPU hotplug, |
| 61 | CPU suspend, system suspend, ...) with proper saving of the hardware state. |
| 62 | |
| 63 | - Supports rebooting the platform at the end of each test for greater |
| 64 | independence between tests. |
| 65 | |
| 66 | - Supports interrupting and resuming a test session. This relies on storing |
| 67 | test results in non-volatile memory (e.g. flash). |
| 68 | |
| 69 | FWU images |
| 70 | `````````` |
| 71 | |
| 72 | - Provides example code to exercise the Firmware Update feature of TF-A. |
| 73 | |
| 74 | - Tests the robustness of the FWU state machine implemented in the TF-A by |
| 75 | sending valid and invalid authentication, copy and image execution requests |
| 76 | to the TF-A BL1 image. |
| 77 | |
| 78 | EL3 test payload |
| 79 | ```````````````` |
| 80 | |
| 81 | - Tests the ability of TF-A to load an EL3 payload. |
| 82 | |
| 83 | Cactus test secure partition |
| 84 | ```````````````````````````` |
| 85 | |
| 86 | - Tests that TF-A has correctly setup the secure partition environment: it |
| 87 | should be allowed to perform cache maintenance operations, access floating |
| 88 | point registers, etc. |
| 89 | |
| 90 | - Tests the ability of a secure partition to request changing data access |
| 91 | permissions and instruction permissions of memory regions it owns. |
| 92 | |
| 93 | - Tests the ability of a secure partition to handle StandaloneMM requests. |
| 94 | |
| 95 | Known issues and limitations |
| 96 | ---------------------------- |
| 97 | |
| 98 | The sections below lists the known issues and limitations of each test image |
| 99 | provided in this repository. |
| 100 | |
| 101 | TFTF |
| 102 | ```` |
| 103 | |
| 104 | The TFTF test image might be conceptually sub-divided further in 2 parts: the |
| 105 | tests themselves, and the test framework they are based upon. |
| 106 | |
| 107 | Test framework |
| 108 | '''''''''''''' |
| 109 | |
| 110 | - Some stability issues. |
| 111 | |
| 112 | - No mechanism to abort tests when they time out (e.g. this could be |
| 113 | implemented using a watchdog). |
| 114 | |
| 115 | - No convenient way to include or exclude tests on a per-platform basis. |
| 116 | |
| 117 | - Power domains and affinity levels are considered equivalent but they may |
| 118 | not necessarily be. |
| 119 | |
| 120 | - Need to provide better support to alleviate duplication of test code. There |
| 121 | are some recurrent test patterns for which helper functions should be |
| 122 | provided. For example, bringing up all CPUs on the platform and executing the |
| 123 | same function on all of them, or programming an interrupt and waiting for it |
| 124 | to trigger. |
| 125 | |
| 126 | - Every CPU that participates in a test must return from the test function. If |
| 127 | it does not - e.g. because it powered itself off for testing purposes - then |
| 128 | the test framework will wait forever for this CPU. This limitation is too |
| 129 | restrictive for some tests. |
| 130 | |
| 131 | - No protection against interrupted flash operations. If the target is reset |
| 132 | while some data is written to flash, the test framework might behave |
| 133 | incorrectly on reset. |
| 134 | |
| 135 | - When compiling the code, if the generation of the tests_list.c and/or |
| 136 | tests_list.h files fails, the build process is not aborted immediately and |
| 137 | will only fail later on. |
| 138 | |
| 139 | - The directory layout is confusing. Most of the test framework code has been |
| 140 | moved under the ``tftf/`` directory to better isolate it but this effort is |
| 141 | not complete. As a result, there are still some TFTF files scattered around. |
| 142 | |
| 143 | Tests |
| 144 | ''''' |
| 145 | |
| 146 | - Some tests are implemented for AArch64 only and are skipped on AArch32. |
| 147 | |
| 148 | - Some tests are not robust enough: |
| 149 | |
| 150 | - Some tests might hang in some circumstances. For example, they might wait |
| 151 | forever for a condition to become true. |
| 152 | |
| 153 | - Some tests rely on arbitrary time delays instead of proper synchronization |
| 154 | when executing order-sensitive steps. |
| 155 | |
| 156 | - Some tests have been implemented in a practical manner: they seem to work |
| 157 | on actual hardware but they make assumptions that are not guaranteed by |
| 158 | the Arm architecture. Therefore, they might fail on some other platforms. |
| 159 | |
| 160 | - PSCI stress tests are very unreliable and will often hang. The root cause is |
| 161 | not known for sure but this might be due to bad synchronization between CPUs. |
| 162 | |
| 163 | - The GICv2 spurious IRQ test is Juno-specific. In reality, it should only be |
| 164 | GICv2-specific. It should be reworked to remove any platform-specific |
| 165 | assumption. |
| 166 | |
| 167 | - The GICv2 spurious IRQ test sometimes fails with the following error message: |
| 168 | |
| 169 | ``SMC @ lead CPU returned 0xFFFFFFFF 0x8 0xC`` |
| 170 | |
| 171 | The root cause is unknown. |
| 172 | |
| 173 | - The manual tests in AArch32 mode do not work properly. They save some state |
| 174 | information into non-volatile memory in order to detect the reset reason but |
| 175 | this state does not appear to be retained. As a result, these tests keep |
| 176 | resetting infinitely. |
| 177 | |
| 178 | - The FWU tests take a long time to complete. This is because they wait for the |
| 179 | watchdog to reset the system. On FVP, TF-A configures the watchdog period to |
| 180 | about 4 min. This is way too long in an automated testing context. Besides, |
| 181 | the user gets not feedback, which may let them think that the tests are not |
| 182 | working properly. |
| 183 | |
| 184 | - The test "Target timer to a power down cpu" sometimes fails with the |
| 185 | following error message: |
| 186 | |
| 187 | ``Expected timer switch: 4 Actual: 3`` |
| 188 | |
| 189 | The root cause is unknown. |
| 190 | |
| 191 | FWU images |
| 192 | `````````` |
| 193 | |
Sandrine Bailleux | 7af6c6d | 2018-10-22 17:09:07 +0200 | [diff] [blame^] | 194 | - The FWU tests do not work on the revC of the Base AEM FVP. They only work on |
| 195 | the revB. |
| 196 | |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 197 | - NS-BL1U and NS-BL2U images reuse TFTF-specific code for legacy reasons. This |
| 198 | is not a clean design and may cause confusion. |
| 199 | |
| 200 | Cactus test secure partition |
| 201 | ```````````````````````````` |
| 202 | |
| 203 | - Cactus is experimental code. It's likely to change a lot as the secure |
| 204 | partition software architecture evolves. |
| 205 | |
| 206 | - Fails to link with GNU toolchain 7.3.1. |
| 207 | |
| 208 | - Cactus is supported on AArch64 FVP platform only. |
| 209 | |
| 210 | All test images |
| 211 | ``````````````` |
| 212 | |
| 213 | - TF-A Tests are derived from a fork of TF-A so: |
| 214 | |
| 215 | - they've got some code in common but lag behind on some features. |
| 216 | |
| 217 | - there might still be some irrelevant references to TF-A. |
| 218 | |
| 219 | - Some design issues. |
| 220 | E.g. TF-A Tests inherited from the I/O layer of TF-A, which still needs a |
| 221 | major rework. |
| 222 | |
| 223 | - Cannot build TF-A Tests with Clang. Only GCC is supported. |
| 224 | |
| 225 | - The build system does not cope well with parallel building. The user should |
| 226 | not attempt to run multiple jobs in parallel with the ``-j`` option of `GNU |
| 227 | make`. |
| 228 | |
| 229 | - The build system does not properly track build options. A clean build must be |
| 230 | performed every time a build option changes. |
| 231 | |
| 232 | - SMCCC v2 is not properly supported. |
| 233 | |
| 234 | - UUIDs are not compliant to RFC 4122. |
| 235 | |
| 236 | - No floating point support. The code is compiled with GCC flag |
| 237 | ``-mgeneral-regs-only``, which prevents the compiler from generating code |
| 238 | that accesses floating point registers. This might limit some test scenarios. |
| 239 | |
| 240 | - The documentation is too lightweight. |
| 241 | |
| 242 | -------------- |
| 243 | |
| 244 | *Copyright (c) 2018, Arm Limited. All rights reserved.* |