Displaying 1 result from an estimated 1 matches for "free_vmid".
Did you mean:
free_kvmi
2013 Sep 06
2
[PATCH] xen: arm: improve VMID allocation.
...return 0;
}
+#define MAX_VMID 256
+
+/* VTTBR_EL2 VMID field is 8 bits. Using a bitmap here limits us to
+ * 256 concurrent domains. */
+DECLARE_BITMAP(vmid_mask, MAX_VMID);
+
+void p2m_vmid_allocator_init(void)
+{
+ /* VMID 0 is reserved */
+ set_bit(0, vmid_mask);
+}
+
+/* p2m_alloc|free_vmid must both be called with the p2m->lock */
+static int p2m_alloc_vmid(struct domain *d)
+{
+ struct p2m_domain *p2m = &d->arch.p2m;
+
+ int nr = find_first_zero_bit(vmid_mask, MAX_VMID);
+
+ ASSERT(nr > 0); /* VMID is reserved */
+
+ if ( nr == MAX_VMID )
+ {
+ pri...