VHE: Associate a page table with an ASID/VMID

Added an id field to page table structures(struct mm_ptable). This will
help future changes where we can invalidate TLB entries by VMID's and
ASID's. In the near term, this is primarily expected to be useful for
EL0 partitions, where we want to be able to invalidate TLB by ASID's
when mapping/unmapping/replacing page table entries for an EL0
partition.

Change-Id: I3b6ea97eaf4281954ca953cb8f5a40edbf5a2661
Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
diff --git a/inc/hf/mm.h b/inc/hf/mm.h
index b440d6f..b8ed221 100644
--- a/inc/hf/mm.h
+++ b/inc/hf/mm.h
@@ -82,6 +82,11 @@
 	      "A page table must be page aligned.");
 
 struct mm_ptable {
+	/**
+	 * VMID/ASID associated with a page table. ASID 0 is reserved for use by
+	 * the hypervisor.
+	 */
+	uint16_t id;
 	/** Address of the root of the page table. */
 	paddr_t root;
 };
@@ -96,10 +101,11 @@
 
 void mm_vm_enable_invalidation(void);
 
-bool mm_ptable_init(struct mm_ptable *t, int flags, struct mpool *ppool);
+bool mm_ptable_init(struct mm_ptable *t, uint16_t id, int flags,
+		    struct mpool *ppool);
 ptable_addr_t mm_ptable_addr_space_end(int flags);
 
-bool mm_vm_init(struct mm_ptable *t, struct mpool *ppool);
+bool mm_vm_init(struct mm_ptable *t, uint16_t id, struct mpool *ppool);
 void mm_vm_fini(struct mm_ptable *t, struct mpool *ppool);
 
 bool mm_identity_prepare(struct mm_ptable *t, paddr_t begin, paddr_t end,