aboutsummaryrefslogtreecommitdiff
path: root/tftf
AgeCommit message (Collapse)Author
10 daysfix(spm): change error logs to verboseJ-Alves
Helper functions to validate return of FF-A calls or responses from other endpoints in 'spm_common', were printing ERROR also in cases where this was actually expected. Changing those ERROR messages to VERBOSE, given ERROR as referred was misleading. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: Id3feac197e8dbff78a616392b5ac7ca914c219df
2021-04-30Cactus test for exercising SMMUv3 driver to perform stage2 translationMadhukar Pappireddy
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com> Change-Id: I498cb63aed497ab469a38e486a7943dd634e5b36
2021-04-13SPM: test handling of non-secure interrupt while running SPManish Pandey
This patch introduces following test scenario 1. Start a NS timer of 100ms from test framework(TFTF) 2. Send a command to Cactus to block for 200ms so that when NS timer expires, Cactus is still executing. 3. NS timer interrupt traped as FIQ in SPMC which injects Managed exit interrupt in Cactus. 4. Cactus interrupt handler acknowledges handling of interrupt by sending MSG_SEND_DIRECT_RESP to SPMC which in turn forwards it to TFTF. 5. PASS condition for the test is to make sure that - Interrupt occured in Cactus. - Timer interrupt has been forwarded/handled in TFTF. - Time lapsed in whole test is more than 200ms. Change-Id: Iac7a35ac7fa8dd57a1d6bbc0c0797498e09c9b65 Signed-off-by: Manish Pandey <manish.pandey2@arm.com> Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
2021-03-16Merge "TRNG: clean up TRNG test"bipin.ravi
2021-03-15cactus: declare third SP instance as UP SPOlivier Deprez
Third cactus instance is declared as a UP SP in its manifest. This permits exercising the test case of TFTF sending direct message requests from any physical core to the single vCPU (hence migrated) that the SP implements. Signed-off-by: Olivier Deprez <olivier.deprez@arm.com> Change-Id: I70574ebb34ac4f2e2bdb667e8715006167eec6a4
2021-03-15TFTF: Add secondary cores direct messaging test for SPMMax Shvetsov
TFTF starts secondary cores through PSCI_CPU_ON service. As a consequence the SPMD calls into the SPMC and resumes the first SP execution contexts corresponding to each pinned physical core. TFTF then sends a direct message request to the first two (MP) Secure Partitions from each physical core and expects direct message response from the corresponding execution contexts concurrently. Change-Id: I9bdd30461a34e744e59369520870c6f49aca6ca3 Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com> Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
2021-03-15TRNG: clean up TRNG testZelalem
Remove redundant code and add better test cases for TRNG test. Signed-off-by: Zelalem Aweke<zelalem.aweke@arm.com> Change-Id: I497bce918bf9d97f31b460dabdfaadd94887f174
2021-03-12SPM: Helpers for error logging after FF-A callsJ-Alves
Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I7c4cb416baf6eb024eb134edb4bbb62d8746629f
2021-03-12FF-A: Tidying direct messaging API definitionsJ-Alves
Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: Ia04cde158510824086624c1d725f2a6eb68a4702
2021-03-12SPM: Tidying FF-A Memory Sharing testsJ-Alves
Moving code about memory sharing tests to comply with recent changes: - Placed helper functions that can be used by TFTF and Cactus in files spm_common.c/h. - Removed 'ffa_memory_sharing_test' and added its body to handler of test command CACTUS_MEM_SEND_CMD. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I58af9b475730d171306581741becbb0665e1859d
2021-03-12TFTF: Use CACTUS_ECHO_CMD in direct message testsJ-Alves
There were two very similar tests, that were targeted to the same purpose. This patch keeps the logic using an echo value, as it was being used in tests involving SPs. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: Ib278d28098e60dddf807b267951f7e2b8762e9e3
2021-03-11FF-A: Check FF-A return is a valid direct responseJ-Alves
Added a helper function to check if return of FFA_MSG_SEND_DIRECT_REQ is FFA_MSG_SEND_DIRECT_RESP. This is intended to make it easier to maintain cactus test commands framework. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: Ia43e88908aa3cbdd529a8835bffe43dee3e04a76
2021-03-11FF-A: FFA_MSG_DIRECT_RESP call using 5 registersJ-Alves
Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I69c012221743077c962f8099d824ea9452a1df22
2021-03-11Merge "FF-A: Accessors for arguments from FF-A calls"Olivier Deprez
2021-03-08Add tests for TRNG SMCsJimmy Brisson
This adds some tests that are valid for all TRNG implemenations. Specifically, it tests that the Version, Features, and RND calls conform to the spec. Note that UUID is omitted from testing as there is not a value that it can return that's outside of the spec. Change-Id: I68aa2673538f64d2a9401415b8d0de1fdedc3ad4 Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com> Signed-off-by: Zelalem Aweke <zelalem.aweke@arm.com>
2021-03-03FF-A: Accessors for arguments from FF-A callsJ-Alves
Defined some accessors for arguments from FF-A calls, namely for func id, error code, and direct message destination/source. This should help make consistent how they were being handled, enforcing also adequate type checking. Replace the accesses to those FF-A arguments with respective wrapper calls. Change-Id: I99d8e77f3b24728c30eafa3e76a830246790ec5f Signed-off-by: J-Alves <joao.alves@arm.com>
2021-03-02TFTF tests for v8.6 AMU enhancements (FEAT_AMUv1p1)johpow01
Not much can be done with the new AMU offsets running at EL2 (virtual offsets apply at EL0 and EL1) but we can make sure they are being saved and restored properly, so that's what this patch does. Signed-off-by: John Powell <john.powell@arm.com> Change-Id: I5aef85021e875be2109bb9bd7cdbdbe31580394e
2021-02-10[SPM] checks if SIMD vectors are preservedOlivier Deprez
Populates the SIMD registers in the normal world, then modifies those in the secure world. Upon return to the normal world checks that vectors are restored to the original values. Note: Does not check if SIMD vectors are preserved when returning back to the secure world. Signed-off-by: Olivier Deprez <olivier.deprez@arm.com> Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com> Change-Id: I3ae223af64597f83afa6624122109db2cf0077f7
2021-02-10[SPM] tidying common code to tftf and cactusMax Shvetsov
This patch moves the code used to test SPM functionality, not explicitly described in FF-A specification, from ffa_helpers to spm_common which is built for both tftf and cactus. Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com> Change-Id: I461efad977cc4d02701feea7b2215a61453716ef
2021-02-04Merge "Nit: Change name from helper function and macro"Olivier Deprez
2021-01-21Nit: Change name from helper function and macroJ-Alves
Removed reference to Hafnium in name from helper function and macro to make them generic. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I5bdba013b3a0478dc1ef9058e71747480ba5ff1d
2021-01-21Cactus: refactor of cactus_test_cmds.hJ-Alves
Change from macros to static inline functions, to enforce type checking. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I2cbaf99683ca5b2a5689256240894ed05d99e0d8
2021-01-20Cactus: cmd for mem share testsJ-Alves
Previously there was no cmd id for the mem share tests in 'cactus_test_cmds.h', the func id was being reused. For consistency added the cmd id 'CACTUS_MEM_SEND_CMD'. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: Ia2cee00d444d2b753855f2323578df0f9bcf4fb2
2021-01-20TFTF: tests to request SP-to-SP memory shareJ-Alves
Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I06cd2aedf48232dff4c530f1930297f2d962b3f3
2021-01-20TFTF: Refactor FF-A memory sharing testsJ-Alves
- Created helper functions to initialize ffa_memory_region and to send the respective memory region to the SP, making it possible to reuse the logic in SP-to-SP memory share tests. - Added comments to document relevant aspects about memory sharing. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: Id3c6db092d5b5eeed746a5fae30b8c853876fc53
2021-01-20TFTF: SP-to-SP direct messaging deadlock testJ-Alves
TFTF sends CACTUS_REQ_DEADLOCK_CMD to cactus SP. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I1dc243fc5d22a6fe23b453648d69b7405091e05e
2021-01-20TFTF: trigger direct messaging between SPsJ-Alves
Use cactus command 'CACTUS_REQ_ECHO_SEND_CMD' to make cactus SPs communicate with each other using direct message interfaces. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: Idc266cfb8b5661d1b2386d20a2758489f8ac894e
2020-12-23cactus: remove reference to PSA from xml test fileOlivier Deprez
The FF-A specification as been renamed from PSA FF-A v1.0 to FF-A v1.0. Signed-off-by: Olivier Deprez <olivier.deprez@arm.com> Change-Id: Ieef68c270e6213ff58ff9940b1337c43fb7bd25d
2020-12-17Merge "TFTF: Use MTE instructions in 'test_mte_instructions' test"Madhukar Pappireddy
2020-12-15TFTF: helpers for SPM testsJ-Alves
Added functions and macros to help check at the beginning of the test, that system is as expected for SPM tests in which Hafnium is deployed as SPMC. This includes: - Checking SPMC has expected FFA_VERSION; - Checking that expected FF-A endpoints are deployed in the system; - Getting global TFTF mailbox. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I9195bcff8ed93156e838b192bb70a9634e18fbbf
2020-12-14TFTF: Use MTE instructions in 'test_mte_instructions' testAlexei Fedorov
This patch replaces '.inst' AArch64 machine directives with CPU Memory Tagging Extension instructions in 'test_mte_instructions' function. The test code for executing MTE instructions must be compiled with '-march=armv8.5-memtag' option which is provided by setting 'ARM_ARCH_FEATURE=memtag' and 'ARM_ARCH_MINOR=5' build flags in 'tftf_config/fvp-cpu-extensions' when this CI configuration is built separately. Otherwise this compiler's option must be specified explicitly. Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Change-Id: I90f1381733113798069bf77d3a03fcb284607fe5
2020-12-10SPM: RXTX map test on TFTFJ-Alves
Some FF-A interfaces use RXTX buffers to exchange information with SPMC. To avoid repetition of RXTX mapping across the spm-related tests, and prevent allocation of multiple pages for RXTX buffers within TFTF runtime: - Implemented test helpers that hold address of RXTX buffers; - Implemented test to FFA_RXTX_MAP ABI, that also sets value of RXTX buffers; - Cleaned up memory sharing tests that previously implemented RXTX mapping. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I4a67982d3d185bf83809156e4fce03c6edb967d9
2020-11-09Fix race condition in SError inject testDavid Horstmann
tftf/tests/misc_tests/inject_serror.S clears a flag, serror_received, then waits for it to be set by an error handler. However, it currently clears the flag after having started the count down timer to generate the error, so there is a data race between it and the error handler. This can cause the test to fail, if the error is generated and the flag set before it is first cleared. Fix this by clearing the serror_received flag before starting the count down timer. Change-Id: I919ef2a1bba66b19f47bccfcdbee944357881e8f Signed-off-by: David Horstmann <david.horstmann@arm.com>
2020-10-29Merge changes from topic "mem_share"v2.4-rc0Olivier Deprez
* changes: TFTF: tests for FF-A memory sharing operations SPM: FFA endpoints header SPM: TFTF skip test if FFA endpoint absent cactus: adding memory sharing tests cactus: macros for processing of commands SPM: memory sharing functions and structures FFA: Mem sharing ABIs
2020-10-29TFTF: tests for FF-A memory sharing operationsJ-Alves
Test FF-A memory sharing interfaces between tftf and cactus secure partitions. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I837e44ab2cb10b42af23afbc9a94c726b4af7b64
2020-10-29SPM: FFA endpoints headerJ-Alves
Introduced ffa_endpoints.h file, to contain definitions regarding FFA endpoints that are possible to be part of a testing set-up, with either cactus and/or tftf. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: Ia5a94034ad232b319d5a113834421f807f50eaf5
2020-10-28plat: tegra: include standard and validation testsanzhou
When build parameter TESTS is set to tegra194, standard tests will run with platform specific tests. Signed-off-by: anzhou <anzhou@nvidia.com> Signed-off-by: Bo Yan <byan@nvidia.com> Change-Id: If8c2694ce0a9caaa12b59980956a51ed286ea314
2020-10-28aarch64: enable SError abortsVarun Wadekar
This patch enables SError aborts for all CPUs, during their power on sequence. Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Change-Id: I3be0e593c709d65f03275b641b506c8669f2b475
2020-10-28Tegra194: Add platform tag to serror_sdei_event_handleranzhou
The function serror_sdei_event_handler has been defined in inject_serror.S, Tegra194 has different function content with the common function. Rename it to tegra194_serror_sdei_event_handler. Signed-off-by: anzhou <anzhou@nvidia.com> Change-Id: I5a619abcf6aca5215da38f3a74fc229f5b2ec770
2020-10-27cactus: macros for processing of commandsJ-Alves
Set of macros to be used for sending and handling commands to and from cactus. The implemented macros use ffa direct messaging interfaces. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I4e02933167ce078d3a467881eece588fa460510b
2020-10-27SPM: memory sharing functions and structuresJ-Alves
Added structures and functions for memory sharing operations: Structures are defined according to the FFA specification; the functions encompass structures initialization helpers. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: Ic4e6adbf4e7085a2d62373ed823934c42f539d12
2020-10-27FFA: Mem sharing ABIsJ-Alves
Implementation of wrappers for FFA ABI calls: - FFA_MEM_DONATE; - FFA_MEM_LEND; - FFA_MEM_SHARE; - FFA_MEM_RETRIEVE_REQ; - FFA_MEM_RELINQUISH; - FFA_MEM_RECLAIM. Signed-off-by: J-Alves <joao.alves@arm.com> Change-Id: I44853190d11689501a84bf3624b9b0bf6cfb06a7
2020-10-23Tegra194: support GET_SMMU_PER testinganzhou
This patch introduces a test to get return value from SMC SiP function TEGRA_SIP_GET_SMMU_PER. This is a common function for all Tegra platforms. This patch enables the test for Tegra194 platforms. Signed-off-by: anzhou <anzhou@nvidia.com> Change-Id: I14d82aecdbccc02ce3965b52230500bf487a0cc3
2020-10-23Tegra194: introduce tests to verify the Video Memory resize interfaceVarun Wadekar
Tegra platforms provide support to program the Video memory aperture and increase or decrease the size at run time. This test verifies the interface for the following positive and negative scenarios: * verify that incorrect input parameters are handled properly * verify that the memory region is programmed and can be resized later * verify that no information is leaked after the resize operation Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Change-Id: Id554b2c565a85a62ba4524b2faf7d41d3d506f18
2020-10-23timers: remove dependency on SYS_CNT_BASE1Varun Wadekar
The Arm ARM Section D11.1.1 titled "The full set of Generic Timer components" says that Memory-mapped timers are optional. The timer framework and tests use the SYS_CNT_BASE1 macro to read the memory mapped timers. But they can also read the CNTPCT_EL0 system register to get the same value to accommodate all Arm platforms. This patch replaces the usage of SYS_CNT_BASE1 from the timer code with calls to syscounter_read(). Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Change-Id: I4d9ee5587351ee737800539f4d48606e7de80538
2020-10-19SMC fuzzing module integration.Mark Dykes
This includes one test with one seed as the initial implementation. A future upgrade will include an enhanced seeding strategy. The patch includes an example device tree file with the actual test (sdei.dts) leveraging the SDEI functions that can be called without reference to system state. Platform CI will have a single TFTF config to be used in all future testing. Once both branches of TFA tests and platform CI are checked in a user can invoke the testing with: workspace=<workspace location> test_groups=fvp-aarch64-sdei,fvp-smcfuzzing:fvp-tftf-fip.tftf-aemv8a test_run=1 bin_mode=debug retain_paths=1 ./platform-ci/script/run_local_ci.sh Signed-off-by: Mark Dykes <mark.dykes@arm.com> Change-Id: Ic290e7255bcfd845c0d22037e0b670a6691541df
2020-10-14Merge "Remove dependencies from FVP to generic code"Madhukar Pappireddy
2020-10-09Remove dependencies from FVP to generic codeJavier Almansa Sobrino
Some generic parts of TFTF have dependencies from FVP platform macros which can cause some trouble when porting the tests to a different platform. Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com> Change-Id: I11eb1af142b8c0ee1de2fcc8f298658bceedf306
2020-10-07Add test for SDEI RM_ANY routing modejohpow01
Previously, there were no tests using the RM_ANY routing mode. That particular flag doesn't affect code flow very much, it's mainly used for GIC configuration of the interrupt, so this is a test of basic functionality. This test case makes sure RM_ANY event registrtation works and that events can be routed to all CPUs. It does this by registering an SDEI event with the RM_ANY flag, powering up all CPUs, then generating events. Each time a CPU receives an event it shuts off and the process repeats. Every CPU must receive a single event or the test will not pass. Signed-off-by: John Powell <john.powell@arm.com> Change-Id: I1ebd0565158d93bddbf58d680d4696086ac00234
2020-09-17cactus: re-align secure partition idOlivier Deprez
According to [1] and [2] secure partition ids are defined from 0x8001 to 0xfffe. Update the cactus test payload and TFTF such that it uses the appropriate IDs. 0x8000 and 0xffff are reserved FF-A IDs respectively for the SPMC and the SPMD. Conversely in the NWd, the Hypervisor ID is 0 and VMs are numbered in the range of 1 to 0x7fff. [1] https://trustedfirmware-a.readthedocs.io/en/latest/components/ secure-partition-manager.html#ffa-id-get [2] https://review.trustedfirmware.org/c/hafnium/hafnium/+/5165 Signed-off-by: Olivier Deprez <olivier.deprez@arm.com> Change-Id: I3e9786212b227e6637a7650e60ddc4e59ad05a46