diff options
author | Vivek Goyal <vgoyal@in.ibm.com> | 2007-05-02 13:27:07 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 13:27:07 -0400 |
commit | cfd243d4af7c7f8f52f5cb99d3932d9074b039ff (patch) | |
tree | ae9b25a414117d0d39b535e5701d5a1b3f907558 /arch/x86_64/mm | |
parent | bdb96a6614cfaba24e23dd9de4040c068c3af19b (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/mm')
-rw-r--r-- | arch/x86_64/mm/init.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index 4ab3d40aac90..b0a607892183 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c | |||
@@ -378,21 +378,6 @@ void __meminit init_memory_mapping(unsigned long start, unsigned long end) | |||
378 | __flush_tlb_all(); | 378 | __flush_tlb_all(); |
379 | } | 379 | } |
380 | 380 | ||
381 | void __cpuinit zap_low_mappings(int cpu) | ||
382 | { | ||
383 | if (cpu == 0) { | ||
384 | pgd_t *pgd = pgd_offset_k(0UL); | ||
385 | pgd_clear(pgd); | ||
386 | } else { | ||
387 | /* | ||
388 | * For AP's, zap the low identity mappings by changing the cr3 | ||
389 | * to init_level4_pgt and doing local flush tlb all | ||
390 | */ | ||
391 | asm volatile("movq %0,%%cr3" :: "r" (__pa_symbol(&init_level4_pgt))); | ||
392 | } | ||
393 | __flush_tlb_all(); | ||
394 | } | ||
395 | |||
396 | #ifndef CONFIG_NUMA | 381 | #ifndef CONFIG_NUMA |
397 | void __init paging_init(void) | 382 | void __init paging_init(void) |
398 | { | 383 | { |
@@ -569,15 +554,6 @@ void __init mem_init(void) | |||
569 | reservedpages << (PAGE_SHIFT-10), | 554 | reservedpages << (PAGE_SHIFT-10), |
570 | datasize >> 10, | 555 | datasize >> 10, |
571 | initsize >> 10); | 556 | initsize >> 10); |
572 | |||
573 | #ifdef CONFIG_SMP | ||
574 | /* | ||
575 | * Sync boot_level4_pgt mappings with the init_level4_pgt | ||
576 | * except for the low identity mappings which are already zapped | ||
577 | * in init_level4_pgt. This sync-up is essential for AP's bringup | ||
578 | */ | ||
579 | memcpy(boot_level4_pgt+1, init_level4_pgt+1, (PTRS_PER_PGD-1)*sizeof(pgd_t)); | ||
580 | #endif | ||
581 | } | 557 | } |
582 | 558 | ||
583 | void free_init_pages(char *what, unsigned long begin, unsigned long end) | 559 | void free_init_pages(char *what, unsigned long begin, unsigned long end) |