aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/head.S
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@in.ibm.com>2007-05-02 13:27:07 -0400
committerAndi Kleen <andi@basil.nowhere.org>2007-05-02 13:27:07 -0400
commitcfd243d4af7c7f8f52f5cb99d3932d9074b039ff (patch)
treeae9b25a414117d0d39b535e5701d5a1b3f907558 /arch/x86_64/kernel/head.S
parentbdb96a6614cfaba24e23dd9de4040c068c3af19b (diff)
[PATCH] x86-64: Remove the identity mapping as early as possible
With the rewrite of the SMP trampoline and the early page allocator there is nothing that needs identity mapped pages, once we start executing C code. So add zap_identity_mappings into head64.c and remove zap_low_mappings() from much later in the code. The functions are subtly different thus the name change. This also kills boot_level4_pgt which was from an earlier attempt to move the identity mappings as early as possible, and is now no longer needed. Essentially I have replaced boot_level4_pgt with trampoline_level4_pgt in trampoline.S Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/kernel/head.S')
-rw-r--r--arch/x86_64/kernel/head.S39
1 files changed, 14 insertions, 25 deletions
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S
index 926aa2197aaa..c211e52f1333 100644
--- a/arch/x86_64/kernel/head.S
+++ b/arch/x86_64/kernel/head.S
@@ -71,7 +71,7 @@ startup_32:
71 movl %eax, %cr4 71 movl %eax, %cr4
72 72
73 /* Setup early boot stage 4 level pagetables */ 73 /* Setup early boot stage 4 level pagetables */
74 movl $(boot_level4_pgt - __START_KERNEL_map), %eax 74 movl $(init_level4_pgt - __START_KERNEL_map), %eax
75 movl %eax, %cr3 75 movl %eax, %cr3
76 76
77 /* Setup EFER (Extended Feature Enable Register) */ 77 /* Setup EFER (Extended Feature Enable Register) */
@@ -115,7 +115,7 @@ ENTRY(secondary_startup_64)
115 movq %rax, %cr4 115 movq %rax, %cr4
116 116
117 /* Setup early boot stage 4 level pagetables. */ 117 /* Setup early boot stage 4 level pagetables. */
118 movq $(boot_level4_pgt - __START_KERNEL_map), %rax 118 movq $(init_level4_pgt - __START_KERNEL_map), %rax
119 movq %rax, %cr3 119 movq %rax, %cr3
120 120
121 /* Check if nx is implemented */ 121 /* Check if nx is implemented */
@@ -274,9 +274,19 @@ ENTRY(name)
274 i = i + 1 ; \ 274 i = i + 1 ; \
275 .endr 275 .endr
276 276
277 /*
278 * This default setting generates an ident mapping at address 0x100000
279 * and a mapping for the kernel that precisely maps virtual address
280 * 0xffffffff80000000 to physical address 0x000000. (always using
281 * 2Mbyte large pages provided by PAE mode)
282 */
277NEXT_PAGE(init_level4_pgt) 283NEXT_PAGE(init_level4_pgt)
278 /* This gets initialized in x86_64_start_kernel */ 284 .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
279 .fill 512,8,0 285 .fill 257,8,0
286 .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
287 .fill 252,8,0
288 /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
289 .quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE
280 290
281NEXT_PAGE(level3_ident_pgt) 291NEXT_PAGE(level3_ident_pgt)
282 .quad level2_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE 292 .quad level2_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
@@ -307,27 +317,6 @@ NEXT_PAGE(level2_kernel_pgt)
307#undef NEXT_PAGE 317#undef NEXT_PAGE
308 318
309 .data 319 .data
310
311#ifndef CONFIG_HOTPLUG_CPU
312 __INITDATA
313#endif
314 /*
315 * This default setting generates an ident mapping at address 0x100000
316 * and a mapping for the kernel that precisely maps virtual address
317 * 0xffffffff80000000 to physical address 0x000000. (always using
318 * 2Mbyte large pages provided by PAE mode)
319 */
320 .align PAGE_SIZE
321ENTRY(boot_level4_pgt)
322 .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
323 .fill 257,8,0
324 .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
325 .fill 252,8,0
326 /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
327 .quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE
328
329 .data
330
331 .align 16 320 .align 16
332 .globl cpu_gdt_descr 321 .globl cpu_gdt_descr
333cpu_gdt_descr: 322cpu_gdt_descr: