PSA FF-A: map secondary VM memory/device regions in its stage-2 mapping
Add support for mapping secondary VM's memory/device regions in its
stage-2 translation along with unmapping it from primary VM as all the
regions are by default mapped in primary VM's translation regime.
As per PSA FF-A EAC spec, if memory-region does not have base-address
specified, the memory-region of given size is allocated inside the
partition's translation regime. This patch allocates memory-region at
the end of VM's memory. At the max half the VM's memory can be allocated
to memory regions.
When base-address is present this field specify a PA, VA (for S-EL0
partitions) or IPA (for S-EL1 and EL1 partitions). In both cases this
patch identity maps the region.
Change-Id: Id53e66d2109f05e76f8b8dbe85e64c84eabd5a5d
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
diff --git a/inc/hf/addr.h b/inc/hf/addr.h
index efb1844..59e1b7a 100644
--- a/inc/hf/addr.h
+++ b/inc/hf/addr.h
@@ -55,6 +55,14 @@
}
/**
+ * Move backward physical address.
+ */
+static inline paddr_t pa_subtract(paddr_t pa, size_t n)
+{
+ return pa_init(pa_addr(pa) - n);
+}
+
+/**
* Returns the difference between two physical addresses.
*/
static inline size_t pa_difference(paddr_t start, paddr_t end)