FF-A: Booting SPs according to 'boot-order'

Secure Hafnium boots partitions according to boot-order in the manifest.
In this patch:
- Added manifest parsing of "boot-order", and populated VM structure
with it;
- Added the field "next_boot" to the VM structure, in order to create a
boot list that is sorted by the "boot-order";
- The root of the list points to the highest priority VM;
- Booting consists on traversing the list upon use of MSG_WAIT
interface from the highest priority VMs;
- After traversing the whole boot list, returns execution to SPMD;
- "manifest_Test.cc" updated to include "boot-order" field in
tests to the partition manifest;
- "vm_test.cc" updated to include unit test for the main logic of this
patch.

Change-Id: I43adf90447eed3bc24c8eb2ccb8eb979b471f3c3
Signed-off-by: J-Alves <Joao.Alves@arm.com>
diff --git a/src/manifest_test.cc b/src/manifest_test.cc
index 98caf85..890ab26 100644
--- a/src/manifest_test.cc
+++ b/src/manifest_test.cc
@@ -235,6 +235,7 @@
 		Property("load-address", "<0x7000000>");
 		Property("entrypoint-offset", "<0x00001000>");
 		Property("xlat-granule", "<0>");
+		Property("boot-order", "<0>");
 		Property("messaging-method", "<1>");
 		return *this;
 	}
@@ -730,6 +731,10 @@
 
 TEST(manifest, ffa_validate_sanity_check)
 {
+	/*
+	 * TODO: write test excluding all optional fields of the manifest, in
+	 * accordance with specification.
+	 */
 	struct manifest m;
 
 	/* Incompatible version */
@@ -744,6 +749,7 @@
 		.Property("load-address", "<0x7000000>")
 		.Property("entrypoint-offset", "<0x00001000>")
 		.Property("xlat-granule", "<0>")
+		.Property("boot-order", "<0>")
 		.Property("messaging-method", "<1>")
 		.Build();
 	/* clang-format on */
@@ -762,6 +768,7 @@
 		.Property("load-address", "<0x7000000>")
 		.Property("entrypoint-offset", "<0x00001000>")
 		.Property("xlat-granule", "<3>")
+		.Property("boot-order", "<0>")
 		.Property("messaging-method", "<1>")
 		.Build();
 	/* clang-format on */
@@ -780,6 +787,7 @@
 		.Property("load-address", "<0x7000000>")
 		.Property("entrypoint-offset", "<0x00001000>")
 		.Property("xlat-granule", "<0>")
+		.Property("boot-order", "<0>")
 		.Property("messaging-method", "<1>")
 		.Build();
 	/* clang-format on */
@@ -798,6 +806,7 @@
 		.Property("load-address", "<0x7000000>")
 		.Property("entrypoint-offset", "<0x00001000>")
 		.Property("xlat-granule", "<0>")
+		.Property("boot-order", "<0>")
 		.Property("messaging-method", "<1>")
 		.Build();
 	/* clang-format on */
@@ -816,6 +825,7 @@
 		.Property("load-address", "<0x7000000>")
 		.Property("entrypoint-offset", "<0x00001000>")
 		.Property("xlat-granule", "<0>")
+		.Property("boot-order", "<0>")
 		.Property("messaging-method", "<3>")
 		.Build();
 	/* clang-format on */
@@ -1054,6 +1064,7 @@
 	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);
 	ASSERT_EQ(m.vm[0].sp.messaging_method, INDIRECT_MESSAGING);
 	ASSERT_EQ(m.vm[0].sp.mem_regions[0].base_address, 0x7100000);
 	ASSERT_EQ(m.vm[0].sp.mem_regions[0].page_count, 4);