aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorBorislav Petkov <bp@alien8.de>2010-08-28 09:58:33 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2010-10-20 17:23:55 -0400
commitb40827fa7268fda8a62490728a61c2856f33830b (patch)
treeae16ce8206c3d72ca672a92a46dc0725faba1ced /arch/x86/mm
parentd25e6b0b326278a1096e8334584c3e64517057a3 (diff)
x86-32, mm: Add an initial page table for core bootstrapping
This patch adds an initial page table with low mappings used exclusively for booting APs/resuming after ACPI suspend/machine restart. After this, there's no need to add low mappings to swapper_pg_dir and zap them later or create own swsusp PGD page solely for ACPI sleep needs - we have initial_page_table for that. Signed-off-by: Borislav Petkov <bp@alien8.de> LKML-Reference: <20101020070526.GA9588@liondog.tnic> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/init_32.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 558f2d332076..1aeac2d9df80 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -548,48 +548,6 @@ static void __init pagetable_init(void)
548 permanent_kmaps_init(pgd_base); 548 permanent_kmaps_init(pgd_base);
549} 549}
550 550
551#ifdef CONFIG_ACPI_SLEEP
552/*
553 * ACPI suspend needs this for resume, because things like the intel-agp
554 * driver might have split up a kernel 4MB mapping.
555 */
556char swsusp_pg_dir[PAGE_SIZE]
557 __attribute__ ((aligned(PAGE_SIZE)));
558
559static inline void save_pg_dir(void)
560{
561 copy_page(swsusp_pg_dir, swapper_pg_dir);
562}
563#else /* !CONFIG_ACPI_SLEEP */
564static inline void save_pg_dir(void)
565{
566}
567#endif /* !CONFIG_ACPI_SLEEP */
568
569void zap_low_mappings(bool early)
570{
571 int i;
572
573 /*
574 * Zap initial low-memory mappings.
575 *
576 * Note that "pgd_clear()" doesn't do it for
577 * us, because pgd_clear() is a no-op on i386.
578 */
579 for (i = 0; i < KERNEL_PGD_BOUNDARY; i++) {
580#ifdef CONFIG_X86_PAE
581 set_pgd(swapper_pg_dir+i, __pgd(1 + __pa(empty_zero_page)));
582#else
583 set_pgd(swapper_pg_dir+i, __pgd(0));
584#endif
585 }
586
587 if (early)
588 __flush_tlb();
589 else
590 flush_tlb_all();
591}
592
593pteval_t __supported_pte_mask __read_mostly = ~(_PAGE_NX | _PAGE_GLOBAL | _PAGE_IOMAP); 551pteval_t __supported_pte_mask __read_mostly = ~(_PAGE_NX | _PAGE_GLOBAL | _PAGE_IOMAP);
594EXPORT_SYMBOL_GPL(__supported_pte_mask); 552EXPORT_SYMBOL_GPL(__supported_pte_mask);
595 553
@@ -958,9 +916,6 @@ void __init mem_init(void)
958 916
959 if (boot_cpu_data.wp_works_ok < 0) 917 if (boot_cpu_data.wp_works_ok < 0)
960 test_wp_bit(); 918 test_wp_bit();
961
962 save_pg_dir();
963 zap_low_mappings(true);
964} 919}
965 920
966#ifdef CONFIG_MEMORY_HOTPLUG 921#ifdef CONFIG_MEMORY_HOTPLUG