xen/arm: Move p2m_vmid_allocator_init() inside setup_virt_paging()
authorBhupinder Thakur <bhupinder.thakur@linaro.org>
Fri, 16 Dec 2016 07:16:27 +0000 (12:46 +0530)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 16 Dec 2016 18:42:11 +0000 (10:42 -0800)
Since VMIDs are related to 2nd stage address translation, it makes more sense
to move the call to p2m_vmid_allocator_init(), which initializes the vmid
allocation bitmap, inside setup_virt_paging(), where 2nd stage address translation
is set up.

Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/p2m.c
xen/arch/arm/setup.c
xen/include/asm-arm/p2m.h

index 5d5bb872d2d5ee51b8e1fae63df4210bd1367fd0..6930f8c70a262b7a2850f5601b89721a6f972d31 100644 (file)
@@ -1239,7 +1239,7 @@ static spinlock_t vmid_alloc_lock = SPIN_LOCK_UNLOCKED;
  */
 static DECLARE_BITMAP(vmid_mask, MAX_VMID);
 
-void p2m_vmid_allocator_init(void)
+static void p2m_vmid_allocator_init(void)
 {
     set_bit(INVALID_VMID, vmid_mask);
 }
@@ -1657,6 +1657,9 @@ void __init setup_virt_paging(void)
 #endif
     printk("P2M: %d levels with order-%d root, VTCR 0x%lx\n",
            4 - P2M_ROOT_LEVEL, P2M_ROOT_ORDER, val);
+
+    p2m_vmid_allocator_init();
+
     /* It is not allowed to concatenate a level zero root */
     BUG_ON( P2M_ROOT_LEVEL == 0 && P2M_ROOT_ORDER > 0 );
     setup_virt_paging_one((void *)val);
index 1678871b5ed4cf393cfc2a52db99364ead050b3e..049e4491d6982443f3105034a0ec29d2ba076c7d 100644 (file)
@@ -781,8 +781,6 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     gic_init();
 
-    p2m_vmid_allocator_init();
-
     softirq_init();
 
     tasklet_subsys_init();
index fdb6b47e8314f85d688ef1aee6e40222f30ab000..0987be2d367c236e60da1fb17375f0de1613e649 100644 (file)
@@ -152,9 +152,6 @@ void p2m_altp2m_check(struct vcpu *v, uint16_t idx)
     /* Not supported on ARM. */
 }
 
-/* Initialise vmid allocator */
-void p2m_vmid_allocator_init(void);
-
 /* Second stage paging setup, to be called on all CPUs */
 void setup_virt_paging(void);