diff options
author | Borislav Petkov <bp@alien8.de> | 2010-08-28 09:58:33 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-10-20 17:23:55 -0400 |
commit | b40827fa7268fda8a62490728a61c2856f33830b (patch) | |
tree | ae16ce8206c3d72ca672a92a46dc0725faba1ced /arch/x86/kernel/setup.c | |
parent | d25e6b0b326278a1096e8334584c3e64517057a3 (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/kernel/setup.c')
-rw-r--r-- | arch/x86/kernel/setup.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 322b24fbeafd..af6cf2bfceee 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -728,6 +728,17 @@ void __init setup_arch(char **cmdline_p) | |||
728 | #ifdef CONFIG_X86_32 | 728 | #ifdef CONFIG_X86_32 |
729 | memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); | 729 | memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); |
730 | visws_early_detect(); | 730 | visws_early_detect(); |
731 | |||
732 | /* | ||
733 | * copy kernel address range established so far and switch | ||
734 | * to the proper swapper page table | ||
735 | */ | ||
736 | clone_pgd_range(swapper_pg_dir + KERNEL_PGD_BOUNDARY, | ||
737 | initial_page_table + KERNEL_PGD_BOUNDARY, | ||
738 | KERNEL_PGD_PTRS); | ||
739 | |||
740 | load_cr3(swapper_pg_dir); | ||
741 | __flush_tlb_all(); | ||
731 | #else | 742 | #else |
732 | printk(KERN_INFO "Command line: %s\n", boot_command_line); | 743 | printk(KERN_INFO "Command line: %s\n", boot_command_line); |
733 | #endif | 744 | #endif |
@@ -1009,7 +1020,12 @@ void __init setup_arch(char **cmdline_p) | |||
1009 | paging_init(); | 1020 | paging_init(); |
1010 | x86_init.paging.pagetable_setup_done(swapper_pg_dir); | 1021 | x86_init.paging.pagetable_setup_done(swapper_pg_dir); |
1011 | 1022 | ||
1012 | setup_trampoline_page_table(); | 1023 | #ifdef CONFIG_X86_32 |
1024 | /* sync back kernel address range */ | ||
1025 | clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY, | ||
1026 | swapper_pg_dir + KERNEL_PGD_BOUNDARY, | ||
1027 | KERNEL_PGD_PTRS); | ||
1028 | #endif | ||
1013 | 1029 | ||
1014 | tboot_probe(); | 1030 | tboot_probe(); |
1015 | 1031 | ||