feat: tftf realm extension
This patch adds Realm payload management capabilities to TFTF
to act as a NS Host, it includes creation and destruction of a Realm,
mapping of protected data and creation of all needed RTT levels,
sharing of NS memory buffer from Host to Realm by mapping of
unprotected IPA, create REC and auxiliary granules, exit Realm
using RSI_HOST_CALL ABI.
Older realm_payload name is used now for only R-EL1 test cases,
RMI and SPM test cases have been moved to new file tests-rmi-spm.
New TFTF_MAX_IMAGE_SIZE argument added to FVP platform.mk,
as an offset from where R-EL1 payload memory resources start.
Signed-off-by: Nabil Kahlouche <nabil.kahlouche@arm.com>
Change-Id: Ida4cfd334795879d55924bb33b9b77182a3dcef7
diff --git a/tftf/tests/misc_tests/test_invalid_access.c b/tftf/tests/misc_tests/test_invalid_access.c
index 14be340..7e4a861 100644
--- a/tftf/tests/misc_tests/test_invalid_access.c
+++ b/tftf/tests/misc_tests/test_invalid_access.c
@@ -13,17 +13,15 @@
#ifdef __aarch64__
#include <sync.h>
#endif
-#include <test_helpers.h>
+#include <host_realm_helper.h>
#include <lib/aarch64/arch_features.h>
-#include <runtime_services/realm_payload/realm_payload_test.h>
+#include <test_helpers.h>
#include <tftf_lib.h>
#include <xlat_tables_v2.h>
-
#include <platform_def.h>
#include <cactus_test_cmds.h>
#include <ffa_endpoints.h>
-
/*
* Using "__aarch64__" here looks weird but its unavoidable because of following reason
* This test is part of standard test which runs on all platforms but pre-requisite
@@ -143,7 +141,7 @@
}
/* Delegate the shared page to Realm. */
- retmm = realm_granule_delegate((u_register_t)&share_page);
+ retmm = rmi_granule_delegate((u_register_t)&share_page);
if (retmm != 0UL) {
ERROR("Granule delegate failed!\n");
goto out_unregister;
@@ -161,7 +159,7 @@
out_undelegate:
/* Undelegate the shared page. */
- retmm = realm_granule_undelegate((u_register_t)&share_page);
+ retmm = rmi_granule_undelegate((u_register_t)&share_page);
if (retmm != 0UL) {
ERROR("Granule undelegate failed!\n");
}
@@ -233,7 +231,7 @@
return TEST_RESULT_SKIPPED;
}
- retrmm = realm_version();
+ retrmm = rmi_version();
VERBOSE("RMM version is: %lu.%lu\n",
RMI_ABI_VERSION_GET_MAJOR(retrmm),
@@ -247,17 +245,17 @@
return TEST_RESULT_SKIPPED;
}
- retrmm = realm_granule_delegate((u_register_t)&rd[0]);
+ retrmm = rmi_granule_delegate((u_register_t)&rd[0]);
if (retrmm != 0UL) {
ERROR("Delegate operation returns fail, %lx\n", retrmm);
return TEST_RESULT_FAIL;
}
/* Create a realm using a parameter in a secure physical address space should fail. */
- retrmm = realm_create((u_register_t)&rd[0], params);
+ retrmm = rmi_realm_create((u_register_t)&rd[0], params);
if (retrmm == 0UL) {
ERROR("Realm create operation should fail, %lx\n", retrmm);
- retrmm = realm_destroy((u_register_t)&rd[0]);
+ retrmm = rmi_realm_destroy((u_register_t)&rd[0]);
if (retrmm != 0UL) {
ERROR("Realm destroy operation returns fail, %lx\n", retrmm);
return TEST_RESULT_FAIL;
@@ -269,7 +267,7 @@
return TEST_RESULT_FAIL;
}
- retrmm = realm_granule_undelegate((u_register_t)&rd[0]);
+ retrmm = rmi_granule_undelegate((u_register_t)&rd[0]);
if (retrmm != 0UL) {
INFO("Undelegate operation returns fail, %lx\n", retrmm);
return TEST_RESULT_FAIL;