Pass mapped memory size to secondary VMs on boot in x0.

Bug: 117082339
Change-Id: I851669d79cbae67d0a99dabc026b0919ae4e9ed3
diff --git a/test/hftest/hftest_service.c b/test/hftest/hftest_service.c
index c728e27..455b86a 100644
--- a/test/hftest/hftest_service.c
+++ b/test/hftest/hftest_service.c
@@ -76,7 +76,7 @@
 	}
 }
 
-noreturn void kmain(void)
+noreturn void kmain(size_t memory_size)
 {
 	struct memiter args;
 	hftest_test_fn service;
@@ -111,6 +111,7 @@
 	ctx->abort = abort;
 	ctx->send = (struct spci_message *)send;
 	ctx->recv = (struct spci_message *)recv;
+	ctx->memory_size = memory_size;
 
 	/* Pause so the next time cycles are given the service will be run. */
 	hf_vcpu_yield();
diff --git a/test/hftest/inc/hftest.h b/test/hftest/inc/hftest.h
index 145c2ed..d22cadf 100644
--- a/test/hftest/inc/hftest.h
+++ b/test/hftest/inc/hftest.h
@@ -72,6 +72,7 @@
 
 #define SERVICE_SEND_BUFFER() HFTEST_SERVICE_SEND_BUFFER()
 #define SERVICE_RECV_BUFFER() HFTEST_SERVICE_RECV_BUFFER()
+#define SERVICE_MEMORY_SIZE() HFTEST_SERVICE_MEMORY_SIZE()
 
 /*
  * This must be used exactly once in a test image to signal to the linker that
diff --git a/test/hftest/inc/hftest_impl.h b/test/hftest/inc/hftest_impl.h
index 346e496..13b49f1 100644
--- a/test/hftest/inc/hftest_impl.h
+++ b/test/hftest/inc/hftest_impl.h
@@ -136,6 +136,7 @@
 	/* These are used in services. */
 	struct spci_message *send;
 	struct spci_message *recv;
+	size_t memory_size;
 };
 
 struct hftest_context *hftest_get_context(void);
@@ -296,5 +297,6 @@
 
 #define HFTEST_SERVICE_SEND_BUFFER() hftest_get_context()->send
 #define HFTEST_SERVICE_RECV_BUFFER() hftest_get_context()->recv
+#define HFTEST_SERVICE_MEMORY_SIZE() hftest_get_context()->memory_size
 
 void hftest_register(struct hftest_test test);