test: the FFA_ABORT interface supported only at SWd instances
Any attempt to invoke FFA_ABORT at normal world instance shall return
FFA_NOT_SUPPORTED error status.
Change-Id: I3f9c5cc39da95cbe0f0d87f96ed4b85e3330a82b
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index efea857..d283cd4 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -748,3 +748,8 @@
return ffa_call_ext(req);
}
+
+static inline struct ffa_value ffa_abort_32(uint32_t val)
+{
+ return ffa_call((struct ffa_value){.func = FFA_ABORT_32, .arg2 = val});
+}
diff --git a/test/vmapi/ffa_secure_partition_only/secure_partition.c b/test/vmapi/ffa_secure_partition_only/secure_partition.c
index 9c666f4..2b0595d 100644
--- a/test/vmapi/ffa_secure_partition_only/secure_partition.c
+++ b/test/vmapi/ffa_secure_partition_only/secure_partition.c
@@ -137,6 +137,9 @@
ret = ffa_features(FFA_NOTIFICATION_INFO_GET_64);
EXPECT_EQ(ret.func, FFA_SUCCESS_32);
+
+ ret = ffa_features(FFA_ABORT_32);
+ EXPECT_EQ(ret.func, FFA_SUCCESS_32);
}
static bool v1_1_or_later(void)
diff --git a/test/vmapi/primary_with_secondaries/ffa.c b/test/vmapi/primary_with_secondaries/ffa.c
index 89b2583..1102ffc 100644
--- a/test/vmapi/primary_with_secondaries/ffa.c
+++ b/test/vmapi/primary_with_secondaries/ffa.c
@@ -81,3 +81,17 @@
ret = ffa_rx_release();
EXPECT_EQ(ret.func, FFA_SUCCESS_32);
}
+
+/**
+ * FFA_ABORT interface is not supported for normal world endpoints.
+ */
+TEST(ffa, nwd_ffa_abort_unsupported)
+{
+ struct ffa_value res;
+
+ res = ffa_abort_32(0);
+ EXPECT_FFA_ERROR(res, FFA_NOT_SUPPORTED);
+
+ res = ffa_features(FFA_ABORT_32);
+ EXPECT_FFA_ERROR(res, FFA_NOT_SUPPORTED);
+}