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