Displaying 1 result from an estimated 1 matches for "p2m_vmid_allocator_init".
2013 Sep 06
2
[PATCH] xen: arm: improve VMID allocation.
...t;asm/flushtlb.h>
#include <asm/gic.h>
@@ -306,6 +307,46 @@ int p2m_alloc_table(struct domain *d)
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);
+...