diff options
author | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2018-03-15 10:03:29 +0100 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2018-03-23 12:56:55 +0100 |
commit | c4a96088776e43f9ab74f6b3dc1b28304601af7c (patch) | |
tree | 34ebe1fc3cf82d953395f4ca996ca30edfd7db80 | |
parent | cbc235799c7f6677920d6157f613de5067bceefc (diff) |
Cactus (legacy): Fix MM_COMMUNICATE calls test
Service ID #42 is not recognized by Cactus (it used to be in a
previous version of the code) so the test fails.
Introduce a new service ID (#2) that just makes Cactus return
success. This service may be used to simply check the communication
channel between a client and Cactus.
Use this new service ID from TFTF instead of ID #42.
Note that using this new service over the existing "sleep" service has
2 advantages:
- It speeds up the tests. The timer service is mostly useful for
testing the interrupt routing model but there's no point using it
in the MM_COMMUNICATE tests.
- It may be concurrently called from different CPUs. This is not the
case of the "sleep" service, which involves a shared buffer.
Change-Id: Ifa4391b69314845066912777b1db03ab78239547
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
3 files changed, 6 insertions, 4 deletions
diff --git a/cactus/legacy/cactus_legacy.c b/cactus/legacy/cactus_legacy.c index 43ea681..b6129f2 100644 --- a/cactus/legacy/cactus_legacy.c +++ b/cactus/legacy/cactus_legacy.c @@ -55,6 +55,9 @@ static int32_t cactus_handle_fast_request(int cc, return SPM_SUCCESS; } + case SPS_CHECK_ALIVE: + return SPM_SUCCESS; + default: INFO("Unsupported MM_COMMUNICATE_AARCH64 call with service ID 0x%x, ignoring it\n", sps->id); diff --git a/include/runtime_services/secure_el0_payloads/secure_partition.h b/include/runtime_services/secure_el0_payloads/secure_partition.h index 994c0a8..5d1f56f 100644 --- a/include/runtime_services/secure_el0_payloads/secure_partition.h +++ b/include/runtime_services/secure_el0_payloads/secure_partition.h @@ -71,6 +71,7 @@ typedef struct secure_partition_request_info { /* Define some fast secure partition requests (SPS) IDs. */ #define SPS_TIMER_SLEEP 1 +#define SPS_CHECK_ALIVE 2 #define CACTUS_FAST_REQUEST_SUCCESS 0xCACF900D diff --git a/tests/runtime_services/secure_service/legacy/test_secure_service_handle.c b/tests/runtime_services/secure_service/legacy/test_secure_service_handle.c index effa873..421e4a0 100644 --- a/tests/runtime_services/secure_service/legacy/test_secure_service_handle.c +++ b/tests/runtime_services/secure_service/legacy/test_secure_service_handle.c @@ -17,15 +17,13 @@ #include <test_helpers.h> #include <tftf_lib.h> -#define MM_COMMUNICATE_DUMMY_ID 42 - static event_t cpu_has_finished_test; /* Test routine for test_secure_partition_secondary_cores_seq() */ static test_result_t test_secure_partition_secondary_cores_seq_fn(void) { secure_partition_request_info_t *sps_request - = create_sps_request(MM_COMMUNICATE_DUMMY_ID, NULL, 0); + = create_sps_request(SPS_CHECK_ALIVE, NULL, 0); INFO("Sending MM_COMMUNICATE_AARCH64 from CPU %u\n", platform_get_core_pos(read_mpidr_el1() & MPID_MASK)); @@ -111,7 +109,7 @@ static test_result_t test_secure_partition_secondary_cores_sim_fn(void) u_register_t cpu_mpid = read_mpidr_el1() & MPID_MASK; unsigned int core_pos = platform_get_core_pos(cpu_mpid); secure_partition_request_info_t *sps_request - = create_sps_request(MM_COMMUNICATE_DUMMY_ID, NULL, 0); + = create_sps_request(SPS_CHECK_ALIVE, NULL, 0); smc_args mm_communicate_smc = { MM_COMMUNICATE_AARCH64, |