aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spm/cactus/plat/arm/fvp/include/cactus_platform_def.h2
-rw-r--r--spm/cactus/plat/arm/tc0/fdts/cactus-tertiary.dts2
-rw-r--r--spm/cactus/plat/arm/tc0/include/cactus_platform_def.h2
-rw-r--r--tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c43
4 files changed, 41 insertions, 8 deletions
diff --git a/spm/cactus/plat/arm/fvp/include/cactus_platform_def.h b/spm/cactus/plat/arm/fvp/include/cactus_platform_def.h
index 2e5240ef2..b4c57efed 100644
--- a/spm/cactus/plat/arm/fvp/include/cactus_platform_def.h
+++ b/spm/cactus/plat/arm/fvp/include/cactus_platform_def.h
@@ -20,6 +20,6 @@
#define CACTUS_PRIMARY_EC_COUNT (8U)
#define CACTUS_SECONDARY_EC_COUNT (8U)
-#define CACTUS_TERTIARY_EC_COUNT (8U)
+#define CACTUS_TERTIARY_EC_COUNT (1U)
#endif /* CACTUS_PLATFORM_DEF_H */
diff --git a/spm/cactus/plat/arm/tc0/fdts/cactus-tertiary.dts b/spm/cactus/plat/arm/tc0/fdts/cactus-tertiary.dts
index 724d5956d..3b50530e3 100644
--- a/spm/cactus/plat/arm/tc0/fdts/cactus-tertiary.dts
+++ b/spm/cactus/plat/arm/tc0/fdts/cactus-tertiary.dts
@@ -18,7 +18,7 @@
ffa-version = <0x00010000>; /* 31:16 - Major, 15:0 - Minor */
uuid = <0x79b55c73 0x1d8c44b9 0x859361e1 0x770ad8d2>;
id = <3>;
- execution-ctx-count = <8>;
+ execution-ctx-count = <1>;
exception-level = <2>; /* S-EL1 */
execution-state = <0>; /* AARCH64 */
load-address = <0xfe200000>;
diff --git a/spm/cactus/plat/arm/tc0/include/cactus_platform_def.h b/spm/cactus/plat/arm/tc0/include/cactus_platform_def.h
index d5513142e..42dd29150 100644
--- a/spm/cactus/plat/arm/tc0/include/cactus_platform_def.h
+++ b/spm/cactus/plat/arm/tc0/include/cactus_platform_def.h
@@ -19,6 +19,6 @@
#define CACTUS_PRIMARY_EC_COUNT (8U)
#define CACTUS_SECONDARY_EC_COUNT (8U)
-#define CACTUS_TERTIARY_EC_COUNT (8U)
+#define CACTUS_TERTIARY_EC_COUNT (1U)
#endif /* CACTUS_PLATFORM_DEF_H */
diff --git a/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c b/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c
index df97cf466..0a722e497 100644
--- a/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c
+++ b/tftf/tests/runtime_services/secure_service/test_ffa_direct_messaging.c
@@ -175,8 +175,8 @@ static test_result_t cpu_on_handler(void)
smc_ret_values ffa_ret;
/*
- * Send a direct message request to SP1 from current physical CPU.
- * Notice SP1 ECs are already woken as a result of the PSCI_CPU_ON
+ * Send a direct message request to SP1 (MP SP) from current physical
+ * CPU. Notice SP1 ECs are already woken as a result of the PSCI_CPU_ON
* invocation so they already reached the message loop.
* The SPMC uses the MP pinned context corresponding to the physical
* CPU emitting the request.
@@ -200,15 +200,48 @@ static test_result_t cpu_on_handler(void)
}
/*
- * Send a direct message request to SP2 from current physical CPU.
- * The SPMC uses the MP pinned context corresponding to the physical
- * CPU emitting the request.
+ * Send a direct message request to SP2 (MP SP) from current physical
+ * CPU. The SPMC uses the MP pinned context corresponding to the
+ * physical CPU emitting the request.
*/
ret = send_cactus_echo_cmd(HYP_ID, SP_ID(2), ECHO_VAL2);
if (ret != TEST_RESULT_SUCCESS) {
goto out;
}
+ /*
+ * Send a direct message request to SP3 (UP SP) from current physical CPU.
+ * The SPMC uses the single vCPU migrated to the new physical core.
+ * The single SP vCPU may receive requests from multiple physical CPUs.
+ * Thus it is possible one message is being processed on one core while
+ * another (or multiple) cores attempt sending a new direct message
+ * request. In such case the cores attempting the new request receive
+ * a busy response from the SPMC. To handle this case a retry loop is
+ * implemented permitting some fairness.
+ */
+ uint32_t trial_loop = 5U;
+ while (trial_loop--) {
+ ffa_ret = cactus_echo_send_cmd(HYP_ID, SP_ID(3), ECHO_VAL3);
+ if ((ffa_func_id(ffa_ret) == FFA_ERROR) &&
+ (ffa_error_code(ffa_ret) == FFA_ERROR_BUSY)) {
+ VERBOSE("%s(%u) trial %u\n", __func__, core_pos, trial_loop);
+ waitms(1);
+ continue;
+ }
+
+ if (is_ffa_direct_response(ffa_ret) == true) {
+ if (cactus_get_response(ffa_ret) != CACTUS_SUCCESS ||
+ cactus_echo_get_val(ffa_ret) != ECHO_VAL3) {
+ ERROR("Echo Failed!\n");
+ ret = TEST_RESULT_FAIL;
+ }
+
+ goto out;
+ }
+ }
+
+ ret = TEST_RESULT_FAIL;
+
out:
/* Tell the lead CPU that the calling CPU has completed the test */
tftf_send_event(&cpu_booted[core_pos]);