diff options
author | Madhukar Pappireddy <madhukar.pappireddy@arm.com> | 2021-08-05 15:34:07 -0500 |
---|---|---|
committer | Madhukar Pappireddy <madhukar.pappireddy@arm.com> | 2021-11-05 15:35:57 -0500 |
commit | cd183ef0e73ad74b08e6fbec26b4d95bf57a23c9 (patch) | |
tree | e8b1cd08162961df2f9cd83b7b3284113c508a6d /spm/cactus/cactus_tests | |
parent | 46d06d7e778b4c17b24b8ff4676cde2288528472 (diff) |
feat: add support for secure interrupt handling and completion
As per FF-A v1.1 spec, the conduit used by SPM to signal an interrupt
to S-EL1 Partition is vIRQ and/or ERET.
Depending on the execution state of the vCPU of the target SP,
FFA_INTERRUPT ABI and/or Interrupt ID can be used as parameters during
eret to the SP.
This patch adds support for secure interrupt handling in Cactus SP as
well as adds support for FFA_INTERRUPT ABI in the message loop.
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I173b9e0af11b6fd2605145391da68dfda04a14f2
Diffstat (limited to 'spm/cactus/cactus_tests')
-rw-r--r-- | spm/cactus/cactus_tests/cactus_message_loop.c | 2 | ||||
-rw-r--r-- | spm/cactus/cactus_tests/cactus_test_interrupts.c | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/spm/cactus/cactus_tests/cactus_message_loop.c b/spm/cactus/cactus_tests/cactus_message_loop.c index fde7074..c24f6fc 100644 --- a/spm/cactus/cactus_tests/cactus_message_loop.c +++ b/spm/cactus/cactus_tests/cactus_message_loop.c @@ -32,7 +32,7 @@ bool cactus_handle_cmd(smc_ret_values *cmd_args, smc_ret_values *ret, uint64_t in_cmd; if (cmd_args == NULL || ret == NULL) { - ERROR("Invalid argumentos passed to %s!\n", __func__); + ERROR("Invalid arguments passed to %s!\n", __func__); return false; } diff --git a/spm/cactus/cactus_tests/cactus_test_interrupts.c b/spm/cactus/cactus_tests/cactus_test_interrupts.c index 5cd53d1..ced5dca 100644 --- a/spm/cactus/cactus_tests/cactus_test_interrupts.c +++ b/spm/cactus/cactus_tests/cactus_test_interrupts.c @@ -12,6 +12,8 @@ #include "cactus_message_loop.h" #include "cactus_test_cmds.h" +#include <platform.h> + CACTUS_CMD_HANDLER(sleep_cmd, CACTUS_SLEEP_CMD) { uint64_t time_lapsed; @@ -37,12 +39,19 @@ CACTUS_CMD_HANDLER(sleep_fwd_cmd, CACTUS_FWD_SLEEP_CMD) ffa_id_t fwd_dest = cactus_get_fwd_sleep_dest(*args); uint32_t sleep_ms = cactus_get_sleep_time(*args); - VERBOSE("VM%x requested %x to sleep for value %u\n", ffa_dir_msg_source(*args), fwd_dest, sleep_ms); ffa_ret = cactus_sleep_cmd(vm_id, fwd_dest, sleep_ms); + while (ffa_ret.ret0 == FFA_INTERRUPT) { + /* Received FFA_INTERRUPT in blocked state. */ + VERBOSE("Processing FFA_INTERRUPT while blocked on direct response\n"); + unsigned int my_core_pos = platform_get_core_pos(read_mpidr_el1()); + + ffa_ret = ffa_run(fwd_dest, my_core_pos); + } + 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), |