fix(ff-a): report NPI unsupported on EL0 partition
The `FFA_FEATURES` ABI allows querying support for the "notifications
pending" interrupt starting with FF-A version 1.1 or greater. This is
useful on partitions running at S-EL1, but not at S-EL0. Therefore,
return `FFA_NOT_SUPPORTED` if the querying partition is running at
S-EL0.
Change-Id: Ied83a05136d84b212c11b61282b625e1c5df5c9e
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/src/api.c b/src/api.c
index fcaee80..3afcab8 100644
--- a/src/api.c
+++ b/src/api.c
@@ -2427,8 +2427,11 @@
* FF-A interfaces.
*/
struct ffa_value api_ffa_features(uint32_t feature_function_id,
- uint32_t input_property, uint32_t ffa_version)
+ uint32_t input_property, struct vcpu *current)
{
+ const uint32_t ffa_version = current->vm->ffa_version;
+ const bool el0_partition = current->vm->el0_partition;
+
/*
* According to table 13.8 of FF-A v1.1 Beta 0 spec, bits [30:8] MBZ
* if using a feature ID.
@@ -2541,6 +2544,9 @@
#if (MAKE_FFA_VERSION(1, 1) <= FFA_VERSION_COMPILED)
/* Check support of a feature provided respective feature ID. */
case FFA_FEATURE_NPI:
+ if (el0_partition) {
+ return ffa_error(FFA_NOT_SUPPORTED);
+ }
return api_ffa_feature_success(HF_NOTIFICATION_PENDING_INTID);
case FFA_FEATURE_SRI:
if (!ffa_is_vm_id(current->vm->id)) {