aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/boot/x86_64.S
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-09-11 16:04:49 +0200
committerJan Beulich <jbeulich@suse.com>2012-09-11 16:04:49 +0200
commit9badeb5dcd4deaebcab6d736943b8ffc2afdacb3 (patch)
tree80bd65a8aac04a148a196ff24e596dcc3d8901bf /xen/arch/x86/boot/x86_64.S
parenta495404575be41b26d86464b1ecc33c4a0d4b90f (diff)
downloadxen-9badeb5dcd4deaebcab6d736943b8ffc2afdacb3.tar.gz
xen-9badeb5dcd4deaebcab6d736943b8ffc2afdacb3.tar.bz2
xen-9badeb5dcd4deaebcab6d736943b8ffc2afdacb3.zip
x86-64: construct static, uniform parts of page tables at build time
... rather than at boot time, removing unnecessary redundancy between EFI and legacy boot code. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/boot/x86_64.S')
-rw-r--r--xen/arch/x86/boot/x86_64.S70
1 files changed, 69 insertions, 1 deletions
diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S
index 8c7bb6ec43..ed3888d469 100644
--- a/xen/arch/x86/boot/x86_64.S
+++ b/xen/arch/x86/boot/x86_64.S
@@ -128,10 +128,13 @@ ENTRY(boot_cpu_compat_gdt_table)
.quad 0x0000910000000000 /* per-CPU entry (limit == cpu) */
.align PAGE_SIZE, 0
+ .globl __page_tables_start, __page_tables_end
+__page_tables_start:
+
/* Mapping of first 16 megabytes of memory. */
.globl l2_identmap
l2_identmap:
- .quad 0
+ .quad sym_phys(l1_identmap) + __PAGE_HYPERVISOR
pfn = 0
.rept 7
pfn = pfn + (1 << PAGETABLE_ORDER)
@@ -139,3 +142,68 @@ l2_identmap:
.endr
.fill 4 * L2_PAGETABLE_ENTRIES - 8, 8, 0
.size l2_identmap, . - l2_identmap
+
+ .globl l2_xenmap
+l2_xenmap:
+ idx = 0
+ .rept 8
+ .quad sym_phys(__image_base__) + (idx << L2_PAGETABLE_SHIFT) + (PAGE_HYPERVISOR | _PAGE_PSE)
+ idx = idx + 1
+ .endr
+ .fill L2_PAGETABLE_ENTRIES - 8, 8, 0
+ .size l2_xenmap, . - l2_xenmap
+
+l2_fixmap:
+ idx = 0
+ .rept L2_PAGETABLE_ENTRIES
+ .if idx == l2_table_offset(FIXADDR_TOP - 1)
+ .quad sym_phys(l1_fixmap) + __PAGE_HYPERVISOR
+ .else
+ .quad 0
+ .endif
+ idx = idx + 1
+ .endr
+ .size l2_fixmap, . - l2_fixmap
+
+ .globl l3_identmap
+l3_identmap:
+ idx = 0
+ .rept 4
+ .quad sym_phys(l2_identmap) + (idx << PAGE_SHIFT) + __PAGE_HYPERVISOR
+ idx = idx + 1
+ .endr
+ .fill L3_PAGETABLE_ENTRIES - 4, 8, 0
+ .size l3_identmap, . - l3_identmap
+
+l3_xenmap:
+ idx = 0
+ .rept L3_PAGETABLE_ENTRIES
+ .if idx == l3_table_offset(XEN_VIRT_START)
+ .quad sym_phys(l2_xenmap) + __PAGE_HYPERVISOR
+ .elseif idx == l3_table_offset(FIXADDR_TOP - 1)
+ .quad sym_phys(l2_fixmap) + __PAGE_HYPERVISOR
+ .else
+ .quad 0
+ .endif
+ idx = idx + 1
+ .endr
+ .size l3_xenmap, . - l3_xenmap
+
+/* Top-level master (and idle-domain) page directory. */
+ .globl idle_pg_table
+idle_pg_table:
+ .quad sym_phys(l3_bootmap) + __PAGE_HYPERVISOR
+ idx = 1
+ .rept L4_PAGETABLE_ENTRIES - 1
+ .if idx == l4_table_offset(DIRECTMAP_VIRT_START)
+ .quad sym_phys(l3_identmap) + __PAGE_HYPERVISOR
+ .elseif idx == l4_table_offset(XEN_VIRT_START)
+ .quad sym_phys(l3_xenmap) + __PAGE_HYPERVISOR
+ .else
+ .quad 0
+ .endif
+ idx = idx + 1
+ .endr
+ .size idle_pg_table, . - idle_pg_table
+
+__page_tables_end: