diff options
author | Olivier Deprez <olivier.deprez@arm.com> | 2020-09-15 16:57:00 +0200 |
---|---|---|
committer | Olivier Deprez <olivier.deprez@arm.com> | 2020-09-17 12:18:05 +0200 |
commit | 73d81cf12f362e7cf80d0b9cc214b7e0d3ffb3c4 (patch) | |
tree | c5aadd3fde1dfcf08e9c2e9dcbaf849a9b552b7f | |
parent | 0be4abe25703475fa011257c9cd8ff8031d900b2 (diff) | |
download | tf-a-tests-73d81cf12f362e7cf80d0b9cc214b7e0d3ffb3c4.tar.gz |
cactus: break the message loop on bad message request
When the FF-A direct message request is not received as expected
prefer breaking the message loop and panicing rather than replying
with the FF-A error ABI to the SPMC. It is improper to use this
latter ABI in context of Hafnium as this is treated as an invalid
SMC issued by the SP.
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I77cd0831a850e775f9996f4ecd1b5a81e6244a53
-rw-r--r-- | spm/cactus/cactus_main.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/spm/cactus/cactus_main.c b/spm/cactus/cactus_main.c index 737fd119f..727ebcb78 100644 --- a/spm/cactus/cactus_main.c +++ b/spm/cactus/cactus_main.c @@ -50,18 +50,21 @@ static void __dead2 message_loop(ffa_vm_id_t vm_id) for (;;) { if (ffa_ret.ret0 != FFA_MSG_SEND_DIRECT_REQ_SMC32) { - ffa_ret = ffa_error(-1); - continue; + ERROR("%s(%u) unknown func id 0x%lx\n", + __func__, vm_id, ffa_ret.ret0); + break; } if (ffa_ret.ret1 != vm_id) { - ffa_ret = ffa_error(-2); - continue; + ERROR("%s(%u) invalid vm id 0x%lx\n", + __func__, vm_id, ffa_ret.ret1); + break; } if (ffa_ret.ret2 != HYP_ID) { - ffa_ret = ffa_error(-3); - continue; + ERROR("%s(%u) invalid hyp id 0x%lx\n", + __func__, vm_id, ffa_ret.ret2); + break; } /* @@ -76,6 +79,8 @@ static void __dead2 message_loop(ffa_vm_id_t vm_id) */ ffa_ret = ffa_msg_send_direct_resp(vm_id, HYP_ID, sp_response); } + + panic(); } static const mmap_region_t cactus_mmap[] __attribute__((used)) = { |