aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ-Alves <joao.alves@arm.com>2022-07-05 15:18:14 +0100
committerJoao Alves <joao.alves@arm.com>2022-12-01 18:49:37 +0100
commit5325bc5347c368620e989cf1815e0204addee4c0 (patch)
treec20ff186b27ac748c90e90f9f71e6f7d26ec8785
parentd0195f9b29329b19ccc003b6c4dcf6c8de282ab8 (diff)
downloadhafnium-5325bc5347c368620e989cf1815e0204addee4c0.tar.gz
test(memory share): skip tests lending memory from service
The memory sharing tests are repurposed to run on top of the SPMC, and have execution being driven by the NWd. The tests in which the SVM lends memory the PVM will fail to execute in the SPMC, as an SP can't lend memory to the NWd. Change-Id: Ic268b6d6eb9ac53ec56239f170550d8f3e6368c8 Signed-off-by: J-Alves <joao.alves@arm.com>
-rw-r--r--test/vmapi/primary_with_secondaries/memory_sharing.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/vmapi/primary_with_secondaries/memory_sharing.c b/test/vmapi/primary_with_secondaries/memory_sharing.c
index 65a1f3dde..72ec4b408 100644
--- a/test/vmapi/primary_with_secondaries/memory_sharing.c
+++ b/test/vmapi/primary_with_secondaries/memory_sharing.c
@@ -851,6 +851,16 @@ TEST(memory_sharing, give_memory_and_lose_access)
uint8_t *ptr;
struct ffa_partition_info *service1_info = service1();
+ /*
+ * Currently we don't have a viable way to check the correct NS bit
+ * value in the SPMC. This is particularly a problem when donating
+ * NS memory from the SP to a NWd VM.
+ */
+ if (!IS_VM_ID(service1_info->vm_id)) {
+ HFTEST_LOG("Can't share NS memory from SP.");
+ return;
+ }
+
SERVICE_SELECT(service1_info->vm_id, "give_memory_and_fault", mb.send);
/* Have the memory be given. */
@@ -889,6 +899,11 @@ TEST(memory_sharing, lend_memory_and_lose_access)
uint8_t *ptr;
struct ffa_partition_info *service1_info = service1();
+ if (!IS_VM_ID(service1_info->vm_id)) {
+ HFTEST_LOG("Receiver is an SP, shouldn't do this test.\n");
+ return;
+ }
+
SERVICE_SELECT(service1_info->vm_id, "lend_memory_and_fault", mb.send);
/* Have the memory be lent. */
@@ -1702,6 +1717,11 @@ TEST(memory_sharing, lend_relinquish_RW_X)
uint8_t *ptr = pages;
struct ffa_partition_info *service1_info = service1();
+ if (!IS_VM_ID(service1_info->vm_id)) {
+ HFTEST_LOG("Receiver is an SP, shouldn't do this test.\n");
+ return;
+ }
+
SERVICE_SELECT(service1_info->vm_id, "ffa_memory_lend_relinquish_X",
mb.send);
@@ -1754,6 +1774,11 @@ TEST(memory_sharing, lend_relinquish_RO_X)
uint8_t *ptr = pages;
struct ffa_partition_info *service1_info = service1();
+ if (!IS_VM_ID(service1_info->vm_id)) {
+ HFTEST_LOG("Receiver is an SP, shouldn't do this test.\n");
+ return;
+ }
+
SERVICE_SELECT(service1_info->vm_id, "ffa_memory_lend_relinquish_X",
mb.send);