summaryrefslogtreecommitdiff
path: root/spm/cactus/cactus_tests
diff options
context:
space:
mode:
authorMadhukar Pappireddy <madhukar.pappireddy@arm.com>2022-09-12 11:39:20 -0500
committerMadhukar Pappireddy <madhukar.pappireddy@arm.com>2022-10-04 15:01:22 -0500
commit4b293417d91d67e85e6f1077375f772241d5c131 (patch)
treecdfdb05d79d7d0cff309ff3790b745683329cf96 /spm/cactus/cactus_tests
parent889037307cd441431e448c752ad4fe0cebe8939b (diff)
test(interrupts): hint fwd destination SP could be interrupted
TFTF can send a hint to the destination SP to expect that the forwarded sleep command could be preempted by a non-secure interrupt. This can make the tests exercising SP's response to non-secure interrupt robust by allowing the destination SP to check if the forward destination SP has indeed been preempted. Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com> Change-Id: I808ee6c63687438d0092a53389f11bf9b3dd532d
Diffstat (limited to 'spm/cactus/cactus_tests')
-rw-r--r--spm/cactus/cactus_tests/cactus_test_interrupts.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/spm/cactus/cactus_tests/cactus_test_interrupts.c b/spm/cactus/cactus_tests/cactus_test_interrupts.c
index 13a5e59..c438050 100644
--- a/spm/cactus/cactus_tests/cactus_test_interrupts.c
+++ b/spm/cactus/cactus_tests/cactus_test_interrupts.c
@@ -48,6 +48,8 @@ CACTUS_CMD_HANDLER(sleep_fwd_cmd, CACTUS_FWD_SLEEP_CMD)
ffa_id_t vm_id = ffa_dir_msg_dest(*args);
ffa_id_t fwd_dest = cactus_get_fwd_sleep_dest(*args);
uint32_t sleep_ms = cactus_get_sleep_time(*args);
+ bool hint_interrupted = cactus_get_fwd_sleep_interrupted_hint(*args);
+ bool fwd_dest_interrupted;
VERBOSE("VM%x requested %x to sleep for value %u\n",
ffa_dir_msg_source(*args), fwd_dest, sleep_ms);
@@ -62,6 +64,7 @@ CACTUS_CMD_HANDLER(sleep_fwd_cmd, CACTUS_FWD_SLEEP_CMD)
while ((ffa_func_id(ffa_ret) == FFA_INTERRUPT) ||
is_expected_cactus_response(ffa_ret, MANAGED_EXIT_INTERRUPT_ID,
0)) {
+ fwd_dest_interrupted = true;
if (ffa_func_id(ffa_ret) == FFA_INTERRUPT) {
/* Received FFA_INTERRUPT in blocked state. */
@@ -84,6 +87,13 @@ CACTUS_CMD_HANDLER(sleep_fwd_cmd, CACTUS_FWD_SLEEP_CMD)
}
}
+ if (hint_interrupted && !fwd_dest_interrupted) {
+ ERROR("Forwaded destination of the sleep command was not"
+ " interrupted as anticipated\n");
+ return cactus_error_resp(vm_id, ffa_dir_msg_source(*args),
+ CACTUS_ERROR_TEST);
+ }
+
if (!is_ffa_direct_response(ffa_ret)) {
ERROR("Encountered error in CACTUS_FWD_SLEEP_CMD response\n");
return cactus_error_resp(vm_id, ffa_dir_msg_source(*args),