blob: da749236ff1a111a8cc2adf9b8034c316aea08a3 [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001
2.. section-numbering::
3 :suffix: .
4
5.. contents::
6
7Please note that the Trusted Firmware-A Tests version follows the Trusted
8Firmware-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
10Tests are not guaranteed to be compatible. This also means that a version
11upgrade on the TF-A-Tests side might not necessarily introduce any new feature.
12
Sandrine Bailleux88e96a12019-03-28 09:34:55 +010013
14Trusted Firmware-A Tests - version 2.1
15======================================
16
17New features
18------------
19
20- Add initial support for testing Secure Partition Client Interface (SPCI)
21 and Secure Partition Run-Time (SPRT) standards.
22
23 Exercise the full communication flow throughout the software stack, involving:
24
25 - A Secure-EL0 test partition as the Trusted World agent.
26
27 - TFTF as the Normal World agent.
28
29 - The Secure Partition Manager (SPM) in TF-A.
30
31- Various stability improvements, code refactoring and clean ups.
32
33TFTF
34````
35
36- Reorganize tests build infrastructure to allow the selection of a subset of
37 tests.
38
39- Reorganize the platform layer for improved clarity and simplicity.
40
41- Sanitise inclusion of drivers header files.
42
43- Enhance the test report format for improved clarity and conciseness.
44
45- Dump CPU registers when hitting an unexpected exception. Previously, this
46 would silently loop forever.
47
48- Import libc from TF-A to better align the two code bases.
49
50- New tests:
51
52 - SPM tests for exercising communication through either the MM or SPCI/SPRT
53 interfaces.
54
55 - SMC calling convention tests.
56
57 - Initial tests for Armv8.3 Pointer Authentication support (experimental).
58
59- New platform ports:
60
61 - `Arm SGI-575`_ FVP.
62
63 - Hikey960 board (experimental).
64
65 - `Arm Neoverse Reference Design N1 Edge (RD-N1-Edge)`_ FVP (experimental).
66
67Secure partitions
68`````````````````
69
70We now have 3 Secure Partitions to test the SPM implementation in TF-A.
71
72Cactus-MM
73'''''''''
74
75The Cactus test secure partition provided in version 2.0 has been renamed into
76"*Cactus-MM*". It is still responsible for testing the SPM implementation based
77on the Arm Management Mode Interface.
78
79Cactus
80''''''
81
82This is a new test secure partition (as the former "*Cactus*" has been renamed
83into "*Cactus-MM*", see above).
84
85Unlike *Cactus-MM*, this image tests the SPM implementation based on the SPCI
86and SPRT draft specifications.
87
88It runs in Secure-EL0 and performs the following tasks:
89
90- Test that TF-A has correctly setup the secure partition environment (access
91 to cache maintenance operations, to floating point registers, etc.)
92
93- Test that TF-A accepts to change data access permissions and instruction
94 permissions on behalf of Cactus for memory regions the latter owns.
95
96- Test communication with SPM through SPCI/SPRT interfaces.
97
98Ivy
99'''
100
101This is also a new test secure partition. It is provided in order to test
102multiple partitions support in TF-A. It is derived from Cactus and essentially
103provides the same services but with different identifiers at the moment.
104
105EL3 payload
106```````````
107
108- New platform ports:
109
110 - `Arm SGI-575`_ FVP.
111
112 - `Arm Neoverse Reference Design N1 Edge (RD-N1-Edge)`_ FVP (experimental).
113
114Issues resolved since last release
115----------------------------------
116
117- The GICv2 spurious IRQ test is no longer Juno-specific. It is now only
118 GICv2-specific.
119
120- The manual tests in AArch32 state now work properly. After investigation,
121 we identified that this issue was not AArch32 specific but concerned any
122 test relying on state information persisting across reboots. It was due to
123 an incorrect build configuration.
124
125- Cactus-MM now successfully links with GNU toolchain 7.3.1.
126
127Known issues and limitations
128----------------------------
129
130The sections below lists the known issues and limitations of each test image
131provided in this repository.
132
133TFTF
134````
135
136The TFTF test image might be conceptually sub-divided further in 2 parts: the
137tests themselves, and the test framework they are based upon.
138
139Test framework
140''''''''''''''
141
142- Some stability issues.
143
144- No mechanism to abort tests when they time out (e.g. this could be
145 implemented using a watchdog).
146
147- No convenient way to include or exclude tests on a per-platform basis.
148
149- Power domains and affinity levels are considered equivalent but they may
150 not necessarily be.
151
152- Need to provide better support to alleviate duplication of test code. There
153 are some recurrent test patterns for which helper functions should be
154 provided. For example, bringing up all CPUs on the platform and executing the
155 same function on all of them, or programming an interrupt and waiting for it
156 to trigger.
157
158- Every CPU that participates in a test must return from the test function. If
159 it does not - e.g. because it powered itself off for testing purposes - then
160 the test framework will wait forever for this CPU. This limitation is too
161 restrictive for some tests.
162
163- No protection against interrupted flash operations. If the target is reset
164 while some data is written to flash, the test framework might behave
165 incorrectly on reset.
166
167- When compiling the code, if the generation of the ``tests_list.c`` and/or
168 ``tests_list.h`` files fails, the build process is not aborted immediately
169 and will only fail later on.
170
171- The directory layout requires further improvements. Most of the test
172 framework code has been moved under the ``tftf/`` directory to better isolate
173 it but this effort is not complete. As a result, there are still some TFTF
174 files scattered around.
175
176- Pointer Authentication testing is experimental and incomplete at this stage.
177 It is only enabled on the primary CPU on the cold boot.
178
179Tests
180'''''
181
182- Some tests are implemented for AArch64 only and are skipped on AArch32.
183
184- Some tests are not robust enough:
185
186 - Some tests might hang in some circumstances. For example, they might wait
187 forever for a condition to become true.
188
189 - Some tests rely on arbitrary time delays instead of proper synchronization
190 when executing order-sensitive steps.
191
192 - Some tests have been implemented in a practical manner: they seem to work
193 on actual hardware but they make assumptions that are not guaranteed by
194 the Arm architecture. Therefore, they might fail on some other platforms.
195
196- PSCI stress tests are very unreliable and will often hang. The root cause is
197 not known for sure but this might be due to bad synchronization between CPUs.
198
199- The GICv2 spurious IRQ test sometimes fails with the following error message:
200
201 ``SMC @ lead CPU returned 0xFFFFFFFF 0x8 0xC``
202
203 The root cause is unknown.
204
205- The FWU tests take a long time to complete. This is because they wait for the
206 watchdog to reset the system. On FVP, TF-A configures the watchdog period to
207 about 4 min. This limit is excessive for an automated testing context and
208 leaves the user without feedback and unable to determine if the tests are
209 proceeding properly.
210
211- The test "Target timer to a power down cpu" sometimes fails with the
212 following error message:
213
214 ``Expected timer switch: 4 Actual: 3``
215
216 The root cause is unknown.
217
218FWU images
219``````````
220
221- The FWU tests do not work on the revC of the Base AEM FVP. They only work on
222 the revB.
223
224- NS-BL1U and NS-BL2U images reuse TFTF-specific code for legacy reasons. This
225 is not a clean design and may cause confusion.
226
227Test secure partitions (Cactus, Cactus-MM, Ivy)
228```````````````````````````````````````````````
229
230- This is experimental code. It's likely to change a lot as the secure
231 partition software architecture evolves.
232
233- Supported on AArch64 FVP platform only.
234
235All test images
236```````````````
237
238- TF-A Tests are derived from a fork of TF-A so:
239
240 - they've got some code in common but lag behind on some features.
241
242 - there might still be some irrelevant references to TF-A.
243
244- Some design issues.
245 E.g. TF-A Tests inherited from the I/O layer of TF-A, which still needs a
246 major rework.
247
248- Cannot build TF-A Tests with Clang. Only GCC is supported.
249
250- The build system does not cope well with parallel building. The user should
251 not attempt to run multiple jobs in parallel with the ``-j`` option of `GNU
252 make`.
253
254- The build system does not properly track build options. A clean build must be
255 performed every time a build option changes.
256
257- UUIDs are not compliant to RFC 4122.
258
259- No floating point support. The code is compiled with GCC flag
260 ``-mgeneral-regs-only``, which prevents the compiler from generating code
261 that accesses floating point registers. This might limit some test scenarios.
262
263- The documentation is too lightweight.
264
265- Missing instruction barriers in some places before reading the system counter
266 value. As a result, the CPU could speculatively read it and any delay loop
267 calculations might be off (because based on stale values). We need to examine
268 all such direct reads of the ``CNTPCT_EL0`` register and replace them with a
269 call to ``syscounter_read()`` where appropriate.
270
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +0200271Trusted Firmware-A Tests - version 2.0
272======================================
273
274New features
275------------
276
277This is the first public release of the Trusted Firmware-A Tests source code.
278
279TFTF
280````
281
282- Provides a baremetal test framework to exercise TF-A features through its
283 ``SMC`` interface.
284
285- Integrates easily with TF-A: the TFTF binary is packaged in the FIP image
286 as a ``BL33`` component.
287
288- Standalone binary that runs on the target without human intervention (except
289 for some specific tests that require a manual target reset).
290
291- Designed for multi-core testing. The various sub-frameworks allow maximum
292 parallelism in order to stress the firmware.
293
294- Displays test results on the UART output. This may then be parsed by an
295 external tool and integrated in a continuous integration system.
296
297- Supports running in AArch64 (NS-EL2 or NS-EL1) and AArch32 states.
298
299- Supports parsing a tests manifest (XML file) listing the tests to include in
300 the binary.
301
302- Detects most platform features at run time (e.g. topology, GIC version, ...).
303
304- Provides a topology enumeration framework. Allows tests to easily go through
305 affinity levels and power domain nodes.
306
307- Provides an event framework to synchronize CPU operations in a multi-core
308 context.
309
310- Provides a timer framework. Relies on a single global timer to generate
311 interrupts for all CPUs in the system. This allows tests to easily program
312 interrupts on demand to use as a wake-up event source to come out of CPU
313 suspend state for example.
314
315- Provides a power-state enumeration framework. Abstracts the valid power
316 states supported on the platform.
317
318- Provides helper functions for power management operations (CPU hotplug,
319 CPU suspend, system suspend, ...) with proper saving of the hardware state.
320
321- Supports rebooting the platform at the end of each test for greater
322 independence between tests.
323
324- Supports interrupting and resuming a test session. This relies on storing
325 test results in non-volatile memory (e.g. flash).
326
327FWU images
328``````````
329
330- Provides example code to exercise the Firmware Update feature of TF-A.
331
332- Tests the robustness of the FWU state machine implemented in the TF-A by
333 sending valid and invalid authentication, copy and image execution requests
334 to the TF-A BL1 image.
335
336EL3 test payload
337````````````````
338
339- Tests the ability of TF-A to load an EL3 payload.
340
341Cactus test secure partition
342````````````````````````````
343
344- Tests that TF-A has correctly setup the secure partition environment: it
345 should be allowed to perform cache maintenance operations, access floating
346 point registers, etc.
347
348- Tests the ability of a secure partition to request changing data access
349 permissions and instruction permissions of memory regions it owns.
350
351- Tests the ability of a secure partition to handle StandaloneMM requests.
352
353Known issues and limitations
354----------------------------
355
356The sections below lists the known issues and limitations of each test image
357provided in this repository.
358
359TFTF
360````
361
362The TFTF test image might be conceptually sub-divided further in 2 parts: the
363tests themselves, and the test framework they are based upon.
364
365Test framework
366''''''''''''''
367
368- Some stability issues.
369
370- No mechanism to abort tests when they time out (e.g. this could be
371 implemented using a watchdog).
372
373- No convenient way to include or exclude tests on a per-platform basis.
374
375- Power domains and affinity levels are considered equivalent but they may
376 not necessarily be.
377
378- Need to provide better support to alleviate duplication of test code. There
379 are some recurrent test patterns for which helper functions should be
380 provided. For example, bringing up all CPUs on the platform and executing the
381 same function on all of them, or programming an interrupt and waiting for it
382 to trigger.
383
384- Every CPU that participates in a test must return from the test function. If
385 it does not - e.g. because it powered itself off for testing purposes - then
386 the test framework will wait forever for this CPU. This limitation is too
387 restrictive for some tests.
388
389- No protection against interrupted flash operations. If the target is reset
390 while some data is written to flash, the test framework might behave
391 incorrectly on reset.
392
393- When compiling the code, if the generation of the tests_list.c and/or
394 tests_list.h files fails, the build process is not aborted immediately and
395 will only fail later on.
396
397- The directory layout is confusing. Most of the test framework code has been
398 moved under the ``tftf/`` directory to better isolate it but this effort is
399 not complete. As a result, there are still some TFTF files scattered around.
400
401Tests
402'''''
403
404- Some tests are implemented for AArch64 only and are skipped on AArch32.
405
406- Some tests are not robust enough:
407
408 - Some tests might hang in some circumstances. For example, they might wait
409 forever for a condition to become true.
410
411 - Some tests rely on arbitrary time delays instead of proper synchronization
412 when executing order-sensitive steps.
413
414 - Some tests have been implemented in a practical manner: they seem to work
415 on actual hardware but they make assumptions that are not guaranteed by
416 the Arm architecture. Therefore, they might fail on some other platforms.
417
418- PSCI stress tests are very unreliable and will often hang. The root cause is
419 not known for sure but this might be due to bad synchronization between CPUs.
420
421- The GICv2 spurious IRQ test is Juno-specific. In reality, it should only be
422 GICv2-specific. It should be reworked to remove any platform-specific
423 assumption.
424
425- The GICv2 spurious IRQ test sometimes fails with the following error message:
426
427 ``SMC @ lead CPU returned 0xFFFFFFFF 0x8 0xC``
428
429 The root cause is unknown.
430
431- The manual tests in AArch32 mode do not work properly. They save some state
432 information into non-volatile memory in order to detect the reset reason but
433 this state does not appear to be retained. As a result, these tests keep
434 resetting infinitely.
435
436- The FWU tests take a long time to complete. This is because they wait for the
437 watchdog to reset the system. On FVP, TF-A configures the watchdog period to
438 about 4 min. This is way too long in an automated testing context. Besides,
439 the user gets not feedback, which may let them think that the tests are not
440 working properly.
441
442- The test "Target timer to a power down cpu" sometimes fails with the
443 following error message:
444
445 ``Expected timer switch: 4 Actual: 3``
446
447 The root cause is unknown.
448
449FWU images
450``````````
451
Sandrine Bailleux7af6c6d2018-10-22 17:09:07 +0200452- The FWU tests do not work on the revC of the Base AEM FVP. They only work on
453 the revB.
454
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +0200455- NS-BL1U and NS-BL2U images reuse TFTF-specific code for legacy reasons. This
456 is not a clean design and may cause confusion.
457
458Cactus test secure partition
459````````````````````````````
460
461- Cactus is experimental code. It's likely to change a lot as the secure
462 partition software architecture evolves.
463
464- Fails to link with GNU toolchain 7.3.1.
465
466- Cactus is supported on AArch64 FVP platform only.
467
468All test images
469```````````````
470
471- TF-A Tests are derived from a fork of TF-A so:
472
473 - they've got some code in common but lag behind on some features.
474
475 - there might still be some irrelevant references to TF-A.
476
477- Some design issues.
478 E.g. TF-A Tests inherited from the I/O layer of TF-A, which still needs a
479 major rework.
480
481- Cannot build TF-A Tests with Clang. Only GCC is supported.
482
483- The build system does not cope well with parallel building. The user should
484 not attempt to run multiple jobs in parallel with the ``-j`` option of `GNU
485 make`.
486
487- The build system does not properly track build options. A clean build must be
488 performed every time a build option changes.
489
490- SMCCC v2 is not properly supported.
491
492- UUIDs are not compliant to RFC 4122.
493
494- No floating point support. The code is compiled with GCC flag
495 ``-mgeneral-regs-only``, which prevents the compiler from generating code
496 that accesses floating point registers. This might limit some test scenarios.
497
498- The documentation is too lightweight.
499
500--------------
501
Sandrine Bailleux88e96a12019-03-28 09:34:55 +0100502*Copyright (c) 2018-2019, Arm Limited. All rights reserved.*
503
504.. _Arm Neoverse Reference Design N1 Edge (RD-N1-Edge): https://developer.arm.com/products/system-design/reference-design/neoverse-reference-design
505.. _Arm SGI-575: https://developer.arm.com/products/system-design/fixed-virtual-platforms