]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: Add p2m_ipa_bits
authorEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Fri, 8 May 2015 07:10:09 +0000 (17:10 +1000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 13 May 2015 13:49:39 +0000 (14:49 +0100)
Export p2m_ipa_bits holding the bit size of IPAs used in p2m tables.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@citrix.com>
xen/arch/arm/p2m.c
xen/include/asm-arm/p2m.h

index 59dd23a7f16125689ec88b79f32d0dafdc64f87e..903fa3fefadbdf269b8a72382e7f9072611e8433 100644 (file)
@@ -27,6 +27,8 @@ static unsigned int __read_mostly p2m_root_level;
 
 #define P2M_ROOT_PAGES    (1<<P2M_ROOT_ORDER)
 
+unsigned int __read_mostly p2m_ipa_bits;
+
 static bool_t p2m_valid(lpae_t pte)
 {
     return pte.p2m.valid;
@@ -1518,6 +1520,7 @@ void __init setup_virt_paging(void)
 
 #ifdef CONFIG_ARM_32
     printk("P2M: 40-bit IPA\n");
+    p2m_ipa_bits = 40;
     val |= VTCR_T0SZ(0x18); /* 40 bit IPA */
     val |= VTCR_SL0(0x1); /* P2M starts at first level */
 #else /* CONFIG_ARM_64 */
@@ -1560,9 +1563,10 @@ void __init setup_virt_paging(void)
 
     p2m_root_order = pa_range_info[pa_range].root_order;
     p2m_root_level = 2 - pa_range_info[pa_range].sl0;
+    p2m_ipa_bits = 64 - pa_range_info[pa_range].t0sz;
 
     printk("P2M: %d-bit IPA with %d-bit PA\n",
-           64 - pa_range_info[pa_range].t0sz,
+           p2m_ipa_bits,
            pa_range_info[pa_range].pabits);
 #endif
     printk("P2M: %d levels with order-%d root, VTCR 0x%lx\n",
index 341df55197b2c7904f4dde14fbfd6bd8f3e05edd..63748ef4eb170eb582ce0ef83f33af29932872bc 100644 (file)
@@ -10,6 +10,9 @@
 
 #define paddr_bits PADDR_BITS
 
+/* Holds the bit size of IPAs in p2m tables.  */
+extern unsigned int p2m_ipa_bits;
+
 struct domain;
 
 extern void memory_type_changed(struct domain *);