Pass an FDT to the unit test VMs

Instead of passing the assigned memory size, optionally pass the
FDT to the secondary VMs. The VMs can extract the memory size, as
well as other potentially useful information from the FDT.

This is done to facilitate using the same unit test framework
with kvm-unit-tests, which expects an FDT, as does the Linux
kernel.

Change-Id: I436d86b3f4d1540c1995e01e48289f39e2c23490
Signed-off-by: Fuad Tabba <tabba@google.com>
diff --git a/inc/hf/addr.h b/inc/hf/addr.h
index 00e77c1..efb1844 100644
--- a/inc/hf/addr.h
+++ b/inc/hf/addr.h
@@ -13,6 +13,8 @@
 
 #include "hf/arch/types.h"
 
+#include "hf/check.h"
+
 /** An opaque type for a physical address. */
 typedef struct {
 	uintpaddr_t pa;
@@ -69,6 +71,15 @@
 }
 
 /**
+ * Subtract from a physical address.
+ */
+static inline paddr_t pa_sub(paddr_t pa, size_t n)
+{
+	CHECK((uintptr_t)pa_addr(pa) >= n);
+	return pa_init(pa_addr(pa) - n);
+}
+
+/**
  * Extracts the absolute intermediate physical address.
  */
 static inline uintpaddr_t ipa_addr(ipaddr_t ipa)