fix: allocate hafnium manifest from bss section

Hafnium manifest structure has grown in size with addition of
FF-A fields. It is currently ~26KB. Init allocates the Hafnium
manifest from stack and leads to a stack corruption. CPU stacks
are 4KB in size. This change declares the Hafnium manifest from
BSS rather than stack.

Fixing the above exhibits a side effect with initrd begin and end
param values which must remain zero in context of the SPMC as no
ramdisk is provided.

Change-Id: I2b99e9879f9f90a699d395862692a0304e6a4487
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/src/boot_flow/spmc.c b/src/boot_flow/spmc.c
index 3f29eca..3343cf0 100644
--- a/src/boot_flow/spmc.c
+++ b/src/boot_flow/spmc.c
@@ -32,14 +32,17 @@
 
 /**
  * The value returned by this function is not meaningful in context of the SPMC
- * as there is no initrd.
+ * as there is no initrd. Initrd begin and end values are cleared such that the
+ * check done in one_time_init (initrd_begin is non null) is false, hinting a
+ * ramdisk is not present.
  */
 bool plat_boot_flow_get_initrd_range(const struct fdt *fdt, paddr_t *begin,
 				     paddr_t *end)
 {
 	(void)fdt;
-	(void)begin;
-	(void)end;
+
+	*begin = pa_init(0);
+	*end = pa_init(0);
 
 	return true;
 }
diff --git a/src/init.c b/src/init.c
index ab8d8a4..bff98b1 100644
--- a/src/init.c
+++ b/src/init.c
@@ -38,6 +38,12 @@
 
 static struct mpool ppool;
 
+/*
+ * Hafnium manifest declaring all VMs. Notice this structure is large hence kept
+ * in BSS rather than directly allocated to the stack in one_time_init.
+ */
+static struct manifest manifest;
+
 /**
  * Performs one-time initialisation of memory management for the hypervisor.
  *
@@ -67,7 +73,6 @@
 {
 	struct string manifest_fname = STRING_INIT("manifest.dtb");
 	struct fdt fdt;
-	struct manifest manifest;
 	enum manifest_return_code manifest_ret;
 	struct boot_params params;
 	struct boot_params_update update;