fix: global notifications shall use vCPU ID 0
Calls to FFA_NOTIFICATION_SET for global notifications
must always provide vCPU ID 0.
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: Ib63d88aafb60b7b1d91000aceb4de05be4a69722
diff --git a/src/api.c b/src/api.c
index c733bbf..f86067c 100644
--- a/src/api.c
+++ b/src/api.c
@@ -3883,6 +3883,14 @@
return ffa_error(FFA_INVALID_PARAMETERS);
}
+ /* Global notifications must target any vCPU. */
+ if (!is_per_vcpu && vcpu_id != 0U) {
+ dlog_verbose(
+ "For global notifications vCPU ID MBZ in call to set "
+ "notifications.\n");
+ return ffa_error(FFA_INVALID_PARAMETERS);
+ }
+
if (!plat_ffa_is_notification_set_valid(current, sender_vm_id,
receiver_vm_id)) {
dlog_verbose("Invalid use of notifications set interface.\n");