From: Andrew Cooper Date: Fri, 22 Apr 2016 18:40:02 +0000 (+0100) Subject: Move arch/x86/hvm_pagetables.S into arch/x86/hvm/ directory X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1f14c4b2da1ee0f5d08a1ae92097ecf7df93d109;p=people%2Froyger%2Fxen-test-framework.git Move arch/x86/hvm_pagetables.S into arch/x86/hvm/ directory This is a more appropriate place for it to live. Signed-off-by: Andrew Cooper --- diff --git a/arch/x86/hvm/pagetables.S b/arch/x86/hvm/pagetables.S new file mode 100644 index 0000000..bb74233 --- /dev/null +++ b/arch/x86/hvm/pagetables.S @@ -0,0 +1,77 @@ +#include + +#include + +#define PAGE_COMMON _PAGE_DIRTY + _PAGE_ACCESSED + _PAGE_USER + _PAGE_RW + _PAGE_PRESENT + +#define PAE_IDX(sym) ((. - (sym)) / PAE_PTE_SZ) +#define PSE_IDX(sym) ((. - (sym)) / PSE_PTE_SZ) + + .data + .p2align PAGE_SHIFT + +/* PAE mappings of first 2M of memory in 4k pages. Uses 1x 4k page. */ +GLOBAL(pae_l1_identmap) + .long 0, 0 /* Unmap page at 0 to catch errors with NULL pointers. */ + .rept PAE_L1_PT_ENTRIES - 1 + .long (PAE_IDX(pae_l1_identmap) << PAE_L1_PT_SHIFT) + PAGE_COMMON + .long 0 + .endr +SIZE(pae_l1_identmap) + +/* PAE mappings up to 4G, mostly in 2M superpages. Uses 4x 4k pages. */ +GLOBAL(pae_l2_identmap) + .long pae_l1_identmap + PAGE_COMMON + .long 0 + .rept (4 * PAE_L2_PT_ENTRIES) - 1 + .long (PAE_IDX(pae_l2_identmap) << PAE_L2_PT_SHIFT) + _PAGE_PSE + PAGE_COMMON + .long 0 + .endr +SIZE(pae_l2_identmap) + +/* PAE l3 pagetable. Maps 4x l2 tables. */ +GLOBAL(pae_l3_identmap) + .rept 4 + .long pae_l2_identmap + (PAE_IDX(pae_l3_identmap) << PAGE_SHIFT) + PAGE_COMMON + .long 0 + .endr + .fill PAE_L3_PT_ENTRIES - 4, 8, 0 +SIZE(pae_l3_identmap) + +/* PAE l4 pagetable. Maps 1x l3 table. */ +GLOBAL(pae_l4_identmap) + .long pae_l3_identmap + PAGE_COMMON + .long 0 + .fill PAE_L4_PT_ENTRIES - 1, 8, 0 +SIZE(pae_l4_identmap) + +/* PSE mappings of the first 4M of memory in 4k pages. Uses 1x 4k page. */ +GLOBAL(pse_l1_identmap) + .long 0 /* Unmap page at 0 to catch errors with NULL pointers. */ + .rept PSE_L1_PT_ENTRIES - 1 + .long (PSE_IDX(pse_l1_identmap) << PSE_L1_PT_SHIFT) + PAGE_COMMON + .endr +SIZE(pse_l1_identmap) + +/* PSE mappings up to 4G, mostly in 4M superpages. Uses 1x 4k page. */ +GLOBAL(pse_l2_identmap) + .long pse_l1_identmap + PAGE_COMMON + .rept PSE_L2_PT_ENTRIES - 1 + .long (PSE_IDX(pse_l2_identmap) << PSE_L2_PT_SHIFT) + _PAGE_PSE + PAGE_COMMON + .endr +SIZE(pse_l1_identmap) + +/* PAE l3 32bit quad. Contains 4 64bit entries. */ +GLOBAL(pae32_l3_identmap) + .rept PAE32_L3_ENTRIES + .long pae_l2_identmap + (PAE_IDX(pae32_l3_identmap) << PAGE_SHIFT) + _PAGE_PRESENT + .long 0 + .endr +SIZE(pae32_l3_identmap) + +/* + * Local variables: + * tab-width: 8 + * indent-tabs-mode: nil + * End: + */ diff --git a/arch/x86/hvm_pagetables.S b/arch/x86/hvm_pagetables.S deleted file mode 100644 index bb74233..0000000 --- a/arch/x86/hvm_pagetables.S +++ /dev/null @@ -1,77 +0,0 @@ -#include - -#include - -#define PAGE_COMMON _PAGE_DIRTY + _PAGE_ACCESSED + _PAGE_USER + _PAGE_RW + _PAGE_PRESENT - -#define PAE_IDX(sym) ((. - (sym)) / PAE_PTE_SZ) -#define PSE_IDX(sym) ((. - (sym)) / PSE_PTE_SZ) - - .data - .p2align PAGE_SHIFT - -/* PAE mappings of first 2M of memory in 4k pages. Uses 1x 4k page. */ -GLOBAL(pae_l1_identmap) - .long 0, 0 /* Unmap page at 0 to catch errors with NULL pointers. */ - .rept PAE_L1_PT_ENTRIES - 1 - .long (PAE_IDX(pae_l1_identmap) << PAE_L1_PT_SHIFT) + PAGE_COMMON - .long 0 - .endr -SIZE(pae_l1_identmap) - -/* PAE mappings up to 4G, mostly in 2M superpages. Uses 4x 4k pages. */ -GLOBAL(pae_l2_identmap) - .long pae_l1_identmap + PAGE_COMMON - .long 0 - .rept (4 * PAE_L2_PT_ENTRIES) - 1 - .long (PAE_IDX(pae_l2_identmap) << PAE_L2_PT_SHIFT) + _PAGE_PSE + PAGE_COMMON - .long 0 - .endr -SIZE(pae_l2_identmap) - -/* PAE l3 pagetable. Maps 4x l2 tables. */ -GLOBAL(pae_l3_identmap) - .rept 4 - .long pae_l2_identmap + (PAE_IDX(pae_l3_identmap) << PAGE_SHIFT) + PAGE_COMMON - .long 0 - .endr - .fill PAE_L3_PT_ENTRIES - 4, 8, 0 -SIZE(pae_l3_identmap) - -/* PAE l4 pagetable. Maps 1x l3 table. */ -GLOBAL(pae_l4_identmap) - .long pae_l3_identmap + PAGE_COMMON - .long 0 - .fill PAE_L4_PT_ENTRIES - 1, 8, 0 -SIZE(pae_l4_identmap) - -/* PSE mappings of the first 4M of memory in 4k pages. Uses 1x 4k page. */ -GLOBAL(pse_l1_identmap) - .long 0 /* Unmap page at 0 to catch errors with NULL pointers. */ - .rept PSE_L1_PT_ENTRIES - 1 - .long (PSE_IDX(pse_l1_identmap) << PSE_L1_PT_SHIFT) + PAGE_COMMON - .endr -SIZE(pse_l1_identmap) - -/* PSE mappings up to 4G, mostly in 4M superpages. Uses 1x 4k page. */ -GLOBAL(pse_l2_identmap) - .long pse_l1_identmap + PAGE_COMMON - .rept PSE_L2_PT_ENTRIES - 1 - .long (PSE_IDX(pse_l2_identmap) << PSE_L2_PT_SHIFT) + _PAGE_PSE + PAGE_COMMON - .endr -SIZE(pse_l1_identmap) - -/* PAE l3 32bit quad. Contains 4 64bit entries. */ -GLOBAL(pae32_l3_identmap) - .rept PAE32_L3_ENTRIES - .long pae_l2_identmap + (PAE_IDX(pae32_l3_identmap) << PAGE_SHIFT) + _PAGE_PRESENT - .long 0 - .endr -SIZE(pae32_l3_identmap) - -/* - * Local variables: - * tab-width: 8 - * indent-tabs-mode: nil - * End: - */ diff --git a/build/files.mk b/build/files.mk index 65b32b8..f411c8a 100644 --- a/build/files.mk +++ b/build/files.mk @@ -23,7 +23,7 @@ obj-perenv += $(ROOT)/arch/x86/hypercall_page.o # HVM specific objects -obj-hvm += $(ROOT)/arch/x86/hvm_pagetables.o +obj-hvm += $(ROOT)/arch/x86/hvm/pagetables.o obj-hvm += $(ROOT)/arch/x86/hvm/traps.o $(foreach env,$(HVM_ENVIRONMENTS),$(eval obj-$(env) += $(obj-hvm)))