From 5718ab6ba3b86b2f416f1036e592a9b1beb299c5 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Sun, 5 Jun 2016 18:18:35 +0100 Subject: [PATCH] Create aliases of the live L1 and L2 pagetables Signed-off-by: Andrew Cooper --- arch/x86/hvm/pagetables.S | 12 ++++++++++++ include/arch/x86/page.h | 24 ++++++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/arch/x86/hvm/pagetables.S b/arch/x86/hvm/pagetables.S index b1a2183..a0d5431 100644 --- a/arch/x86/hvm/pagetables.S +++ b/arch/x86/hvm/pagetables.S @@ -76,6 +76,18 @@ PAGETABLE_START(pae32_l3_identmap) .endr PAGETABLE_END(pae32_l3_identmap) + + /* Aliases of the live tables (PAE or PSE as appropriate). */ +#if CONFIG_PAGING_LEVELS >= 3 + .set l1_identmap, pae_l1_identmap + .set l2_identmap, pae_l2_identmap +#else + .set l1_identmap, pse_l1_identmap + .set l2_identmap, pse_l2_identmap +#endif + .global l1_identmap + .global l2_identmap + /* * Local variables: * tab-width: 8 diff --git a/include/arch/x86/page.h b/include/arch/x86/page.h index 117e320..95052c8 100644 --- a/include/arch/x86/page.h +++ b/include/arch/x86/page.h @@ -143,14 +143,22 @@ static inline paddr_t pte_to_paddr(intpte_t pte) #ifdef CONFIG_HVM -extern uint64_t pae_l1_identmap[PAE_L1_PT_ENTRIES]; -extern uint64_t pae_l2_identmap[4 * PAE_L2_PT_ENTRIES]; -extern uint64_t pae_l3_identmap[PAE_L3_PT_ENTRIES]; -extern uint64_t pae_l4_identmap[PAE_L4_PT_ENTRIES]; -extern uint64_t pae32_l3_identmap[PAE32_L3_ENTRIES]; - -extern uint32_t pse_l1_identmap[PSE_L1_PT_ENTRIES]; -extern uint32_t pse_l2_identmap[PSE_L2_PT_ENTRIES]; +extern pae_intpte_t pae_l1_identmap[PAE_L1_PT_ENTRIES]; +extern pae_intpte_t pae_l2_identmap[4 * PAE_L2_PT_ENTRIES]; +extern pae_intpte_t pae_l3_identmap[PAE_L3_PT_ENTRIES]; +extern pae_intpte_t pae_l4_identmap[PAE_L4_PT_ENTRIES]; +extern pae_intpte_t pae32_l3_identmap[PAE32_L3_ENTRIES]; + +extern pse_intpte_t pse_l1_identmap[PSE_L1_PT_ENTRIES]; +extern pse_intpte_t pse_l2_identmap[PSE_L2_PT_ENTRIES]; + +/* Aliases of the live tables (PAE or PSE as appropriate). */ +extern intpte_t l1_identmap[L1_PT_ENTRIES]; +#if CONFIG_PAGING_LEVELS >= 3 +extern intpte_t l2_identmap[4 *L2_PT_ENTRIES]; +#else +extern intpte_t l2_identmap[L2_PT_ENTRIES]; +#endif #endif /* CONFIG_HVM */ -- 2.39.5