OP-TEE SPMC tests
Build and run
Please follow the instructions of Build SPMC tests.
Structure
xtest is the Normal World test application which is used to send multiple FF-A messages to the SPMC and to the test SPs in the Secure World. It is part of the optee_test repository.
The
arm-ffa-userdriver provides access to the FF-A layer from the Normal World user space.xtestuses it to send FF-A messages.The test SPs implement various testing functions which can be invoked from
xtest.
Implementation
- TS
components/service/spm_testimplements the common code of the test SPs.deployments/spm-test*are the test SP deployments. There are currently four test SPs to cover various test scenarios. SPM test SPs use FF-A v1.1 except SPM test SP 2 which uses v1.0 to cover the backwards compatibility test of the SPMC.
- optee_test
ffa_spmc_1000.c contains the SPMC test cases of
xtest.
SPMC test RPC protocol
Tests can invoke the functions of the test SPs via an SPMC test specific RPC interface which is built on top of FF-A direct messages.
Message ID |
Description |
|
|
|
|
|
|---|---|---|---|---|---|---|
EP_TEST_SP |
Run internal SP tests |
|
|
|
|
|
EP_TEST_SP_COMMUNICATION |
Test FF-A direct message request |
|
The destination SP’s FF-A endpoint ID |
|
|
|
EP_TEST_SP_INCREASE |
Increase each |
|
|
|
|
|
EP_TRY_R_ACCESS |
Test shared buffer read access |
|
|
|
|
|
EP_TRY_W_ACCESS |
Test shared buffer write access |
|
|
|
|
|
EP_RETRIEVE |
Do FF-A memory retrieve |
|
Memory handle LSW |
Memory handle MSW |
Sender endpoint ID |
|
EP_RELINQUISH |
Do FF-A memory relinquish |
|
Memory handle LSW |
Memory handle MSW |
Flags |
|
EP_SP_MEM_SHARING |
Test FF-A memory sharing |
|
Target endpoint’s FF-A ID |
|
|
|
EP_SP_MEM_SHARING_MULTI |
Test FF-A memory sharing with multiple endpoints |
|
Target endpoint 1 FF-A ID |
Target endpoint 2 FF-A ID |
|
|
EP_SP_MEM_SHARING_EXC |
Test exclusive FF-A memory sharing |
|
Target endpoint’s FF-A ID |
|
|
|
EP_SP_MEM_INCORRECT_ACCESS |
Negative FF-A memory sharing test |
|
Target endpoint’s FF-A ID |
|
|
|
EP_SP_NOP |
No operation |
|
|
|
|
|
EP_TEST_SP_COMMUNICATION_RESPONSE |
Test FF-A direct message response |
|
|
|
|
|
SP_TEST_OK |
Successful test response |
|
Request specific parameter |
Request specific parameter |
Request specific parameter |
Request specific parameter |
SP_TEST_ERROR |
Error test response |
|
Error code |
|
|
|
Test cases
The following test cases are defined in ffa_spmc_1000.c:
- 1001: Test basic FF-A communication
Try to connect to multiple SPs
Have different SPs sending messages to each other
Test standard SP messages (partition_info_get, get_own_id, …)
- 1002: Test FF-A memory
Test memory sharing between the Normal World and the Secure World
- 1003: Test FF-A memory: SP to SP
Test memory sharing between to SPs
- 1004: Test FF-A memory: Access and flags
Test the different access modifiers and flags when sharing memory
- 1005: Test FF-A memory: multiple receiver
Share a memory region with multiple SPs
Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause