Add check to load address from FF-A manifest
The 'load-address' field in the partition's FF-A manifest should match
value with same purpose of SP package, which is configured in the SPMC
manifest.
Change-Id: I998af5f01541754584a6a7c46f8ffdff18e2a226
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/src/manifest.c b/src/manifest.c
index 4730b4e..2decba6 100644
--- a/src/manifest.c
+++ b/src/manifest.c
@@ -756,6 +756,13 @@
goto exit_unmap;
}
+ if (vm->sp.load_addr != sp_pkg_addr) {
+ dlog_warning(
+ "Partition's load address at its manifest differs"
+ " from specified in partition's package.\n");
+ vm->sp.load_addr = sp_pkg_addr;
+ }
+
ret = sanity_check_ffa_manifest(vm);
exit_unmap:
diff --git a/src/manifest_test.cc b/src/manifest_test.cc
index 890ab26..1571b79 100644
--- a/src/manifest_test.cc
+++ b/src/manifest_test.cc
@@ -232,7 +232,6 @@
Property("execution-ctx-count", "<1>");
Property("exception-level", "<2>");
Property("execution-state", "<0>");
- Property("load-address", "<0x7000000>");
Property("entrypoint-offset", "<0x00001000>");
Property("xlat-granule", "<0>");
Property("boot-order", "<0>");
@@ -686,7 +685,6 @@
.EndChild()
.Build();
/* clang-format on */
-
memiter_init(&it, core_dtb.data(), core_dtb.size());
return manifest_init(mm_stage1_locked, m, &it, &ppool);
}
@@ -703,7 +701,6 @@
.Property("execution-ctx-count", "<1>")
.Property("exception-level", "<2>")
.Property("execution-state", "<0>")
- .Property("load-address", "<0x7000000>")
.Property("entrypoint-offset", "<0x00001000>")
.Property("xlat-granule", "<0>")
.Property("messaging-method", "<1>")
@@ -746,7 +743,6 @@
.Property("execution-ctx-count", "<1>")
.Property("exception-level", "<2>")
.Property("execution-state", "<0>")
- .Property("load-address", "<0x7000000>")
.Property("entrypoint-offset", "<0x00001000>")
.Property("xlat-granule", "<0>")
.Property("boot-order", "<0>")
@@ -765,7 +761,6 @@
.Property("execution-ctx-count", "<1>")
.Property("exception-level", "<2>")
.Property("execution-state", "<0>")
- .Property("load-address", "<0x7000000>")
.Property("entrypoint-offset", "<0x00001000>")
.Property("xlat-granule", "<3>")
.Property("boot-order", "<0>")
@@ -784,7 +779,6 @@
.Property("execution-ctx-count", "<1>")
.Property("exception-level", "<6>")
.Property("execution-state", "<0>")
- .Property("load-address", "<0x7000000>")
.Property("entrypoint-offset", "<0x00001000>")
.Property("xlat-granule", "<0>")
.Property("boot-order", "<0>")
@@ -803,7 +797,6 @@
.Property("execution-ctx-count", "<1>")
.Property("exception-level", "<2>")
.Property("execution-state", "<2>")
- .Property("load-address", "<0x7000000>")
.Property("entrypoint-offset", "<0x00001000>")
.Property("xlat-granule", "<0>")
.Property("boot-order", "<0>")
@@ -822,7 +815,6 @@
.Property("execution-ctx-count", "<1>")
.Property("exception-level", "<2>")
.Property("execution-state", "<0>")
- .Property("load-address", "<0x7000000>")
.Property("entrypoint-offset", "<0x00001000>")
.Property("xlat-granule", "<0>")
.Property("boot-order", "<0>")
@@ -1061,7 +1053,6 @@
ASSERT_EQ(m.vm[0].sp.execution_ctx_count, 1);
ASSERT_EQ(m.vm[0].sp.run_time_el, S_EL1);
ASSERT_EQ(m.vm[0].sp.execution_state, AARCH64);
- ASSERT_EQ(m.vm[0].sp.load_addr, 0x7000000);
ASSERT_EQ(m.vm[0].sp.ep_offset, 0x00001000);
ASSERT_EQ(m.vm[0].sp.xlat_granule, PAGE_4KB);
ASSERT_EQ(m.vm[0].sp.boot_order, 0);