diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 23:37:50 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 23:37:50 -0400 |
| commit | 10f2a2b0f68abf39c06cf519cbc1740fa50f900b (patch) | |
| tree | 70b33e4437ae0d5ac92f56c60b048756bde7f3e4 | |
| parent | 8814011679d1a47d8b0158fc991727a5859471a0 (diff) | |
| parent | b40827fa7268fda8a62490728a61c2856f33830b (diff) | |
Merge branch 'x86-trampoline-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-trampoline-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86-32, mm: Add an initial page table for core bootstrapping
| -rw-r--r-- | arch/x86/include/asm/pgtable_32.h | 2 | ||||
| -rw-r--r-- | arch/x86/include/asm/tlbflush.h | 2 | ||||
| -rw-r--r-- | arch/x86/include/asm/trampoline.h | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/acpi/sleep.c | 7 | ||||
| -rw-r--r-- | arch/x86/kernel/head32.c | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/head_32.S | 55 | ||||
| -rw-r--r-- | arch/x86/kernel/reboot.c | 10 | ||||
| -rw-r--r-- | arch/x86/kernel/setup.c | 18 | ||||
| -rw-r--r-- | arch/x86/kernel/smpboot.c | 16 | ||||
| -rw-r--r-- | arch/x86/kernel/trampoline.c | 16 | ||||
| -rw-r--r-- | arch/x86/mm/init_32.c | 45 |
11 files changed, 56 insertions, 119 deletions
diff --git a/arch/x86/include/asm/pgtable_32.h b/arch/x86/include/asm/pgtable_32.h index f686f49e8b7b..8abde9ec90bf 100644 --- a/arch/x86/include/asm/pgtable_32.h +++ b/arch/x86/include/asm/pgtable_32.h | |||
| @@ -26,7 +26,7 @@ struct mm_struct; | |||
| 26 | struct vm_area_struct; | 26 | struct vm_area_struct; |
| 27 | 27 | ||
| 28 | extern pgd_t swapper_pg_dir[1024]; | 28 | extern pgd_t swapper_pg_dir[1024]; |
| 29 | extern pgd_t trampoline_pg_dir[1024]; | 29 | extern pgd_t initial_page_table[1024]; |
| 30 | 30 | ||
| 31 | static inline void pgtable_cache_init(void) { } | 31 | static inline void pgtable_cache_init(void) { } |
| 32 | static inline void check_pgt_cache(void) { } | 32 | static inline void check_pgt_cache(void) { } |
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h index 7f3eba08e7de..169be8938b96 100644 --- a/arch/x86/include/asm/tlbflush.h +++ b/arch/x86/include/asm/tlbflush.h | |||
| @@ -172,6 +172,4 @@ static inline void flush_tlb_kernel_range(unsigned long start, | |||
| 172 | flush_tlb_all(); | 172 | flush_tlb_all(); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | extern void zap_low_mappings(bool early); | ||
| 176 | |||
| 177 | #endif /* _ASM_X86_TLBFLUSH_H */ | 175 | #endif /* _ASM_X86_TLBFLUSH_H */ |
diff --git a/arch/x86/include/asm/trampoline.h b/arch/x86/include/asm/trampoline.h index 4dde797c0578..f4500fb3b485 100644 --- a/arch/x86/include/asm/trampoline.h +++ b/arch/x86/include/asm/trampoline.h | |||
| @@ -13,16 +13,13 @@ extern unsigned char *trampoline_base; | |||
| 13 | 13 | ||
| 14 | extern unsigned long init_rsp; | 14 | extern unsigned long init_rsp; |
| 15 | extern unsigned long initial_code; | 15 | extern unsigned long initial_code; |
| 16 | extern unsigned long initial_page_table; | ||
| 17 | extern unsigned long initial_gs; | 16 | extern unsigned long initial_gs; |
| 18 | 17 | ||
| 19 | #define TRAMPOLINE_SIZE roundup(trampoline_end - trampoline_data, PAGE_SIZE) | 18 | #define TRAMPOLINE_SIZE roundup(trampoline_end - trampoline_data, PAGE_SIZE) |
| 20 | 19 | ||
| 21 | extern unsigned long setup_trampoline(void); | 20 | extern unsigned long setup_trampoline(void); |
| 22 | extern void __init setup_trampoline_page_table(void); | ||
| 23 | extern void __init reserve_trampoline_memory(void); | 21 | extern void __init reserve_trampoline_memory(void); |
| 24 | #else | 22 | #else |
| 25 | static inline void setup_trampoline_page_table(void) {} | ||
| 26 | static inline void reserve_trampoline_memory(void) {} | 23 | static inline void reserve_trampoline_memory(void) {} |
| 27 | #endif /* CONFIG_X86_TRAMPOLINE */ | 24 | #endif /* CONFIG_X86_TRAMPOLINE */ |
| 28 | 25 | ||
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index e1252074ea40..74a847835bab 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
| @@ -13,6 +13,11 @@ | |||
| 13 | #include <asm/segment.h> | 13 | #include <asm/segment.h> |
| 14 | #include <asm/desc.h> | 14 | #include <asm/desc.h> |
| 15 | 15 | ||
| 16 | #ifdef CONFIG_X86_32 | ||
| 17 | #include <asm/pgtable.h> | ||
| 18 | #include <asm/pgtable_32.h> | ||
| 19 | #endif | ||
| 20 | |||
| 16 | #include "realmode/wakeup.h" | 21 | #include "realmode/wakeup.h" |
| 17 | #include "sleep.h" | 22 | #include "sleep.h" |
| 18 | 23 | ||
| @@ -91,7 +96,7 @@ int acpi_save_state_mem(void) | |||
| 91 | 96 | ||
| 92 | #ifndef CONFIG_64BIT | 97 | #ifndef CONFIG_64BIT |
| 93 | header->pmode_entry = (u32)&wakeup_pmode_return; | 98 | header->pmode_entry = (u32)&wakeup_pmode_return; |
| 94 | header->pmode_cr3 = (u32)(swsusp_pg_dir - __PAGE_OFFSET); | 99 | header->pmode_cr3 = (u32)__pa(&initial_page_table); |
| 95 | saved_magic = 0x12345678; | 100 | saved_magic = 0x12345678; |
| 96 | #else /* CONFIG_64BIT */ | 101 | #else /* CONFIG_64BIT */ |
| 97 | header->trampoline_segment = setup_trampoline() >> 4; | 102 | header->trampoline_segment = setup_trampoline() >> 4; |
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c index 9a6ca2392170..763310165fa0 100644 --- a/arch/x86/kernel/head32.c +++ b/arch/x86/kernel/head32.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <asm/apic.h> | 18 | #include <asm/apic.h> |
| 19 | #include <asm/io_apic.h> | 19 | #include <asm/io_apic.h> |
| 20 | #include <asm/bios_ebda.h> | 20 | #include <asm/bios_ebda.h> |
| 21 | #include <asm/tlbflush.h> | ||
| 21 | 22 | ||
| 22 | static void __init i386_default_early_setup(void) | 23 | static void __init i386_default_early_setup(void) |
| 23 | { | 24 | { |
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index fa8c1b8e09fb..bcece91dd311 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
| @@ -183,13 +183,12 @@ default_entry: | |||
| 183 | #ifdef CONFIG_X86_PAE | 183 | #ifdef CONFIG_X86_PAE |
| 184 | 184 | ||
| 185 | /* | 185 | /* |
| 186 | * In PAE mode swapper_pg_dir is statically defined to contain enough | 186 | * In PAE mode initial_page_table is statically defined to contain |
| 187 | * entries to cover the VMSPLIT option (that is the top 1, 2 or 3 | 187 | * enough entries to cover the VMSPLIT option (that is the top 1, 2 or 3 |
| 188 | * entries). The identity mapping is handled by pointing two PGD | 188 | * entries). The identity mapping is handled by pointing two PGD entries |
| 189 | * entries to the first kernel PMD. | 189 | * to the first kernel PMD. |
| 190 | * | 190 | * |
| 191 | * Note the upper half of each PMD or PTE are always zero at | 191 | * Note the upper half of each PMD or PTE are always zero at this stage. |
| 192 | * this stage. | ||
| 193 | */ | 192 | */ |
| 194 | 193 | ||
| 195 | #define KPMDS (((-__PAGE_OFFSET) >> 30) & 3) /* Number of kernel PMDs */ | 194 | #define KPMDS (((-__PAGE_OFFSET) >> 30) & 3) /* Number of kernel PMDs */ |
| @@ -197,7 +196,7 @@ default_entry: | |||
| 197 | xorl %ebx,%ebx /* %ebx is kept at zero */ | 196 | xorl %ebx,%ebx /* %ebx is kept at zero */ |
| 198 | 197 | ||
| 199 | movl $pa(__brk_base), %edi | 198 | movl $pa(__brk_base), %edi |
| 200 | movl $pa(swapper_pg_pmd), %edx | 199 | movl $pa(initial_pg_pmd), %edx |
| 201 | movl $PTE_IDENT_ATTR, %eax | 200 | movl $PTE_IDENT_ATTR, %eax |
| 202 | 10: | 201 | 10: |
| 203 | leal PDE_IDENT_ATTR(%edi),%ecx /* Create PMD entry */ | 202 | leal PDE_IDENT_ATTR(%edi),%ecx /* Create PMD entry */ |
| @@ -226,14 +225,14 @@ default_entry: | |||
| 226 | movl %eax, pa(max_pfn_mapped) | 225 | movl %eax, pa(max_pfn_mapped) |
| 227 | 226 | ||
| 228 | /* Do early initialization of the fixmap area */ | 227 | /* Do early initialization of the fixmap area */ |
| 229 | movl $pa(swapper_pg_fixmap)+PDE_IDENT_ATTR,%eax | 228 | movl $pa(initial_pg_fixmap)+PDE_IDENT_ATTR,%eax |
| 230 | movl %eax,pa(swapper_pg_pmd+0x1000*KPMDS-8) | 229 | movl %eax,pa(initial_pg_pmd+0x1000*KPMDS-8) |
| 231 | #else /* Not PAE */ | 230 | #else /* Not PAE */ |
| 232 | 231 | ||
| 233 | page_pde_offset = (__PAGE_OFFSET >> 20); | 232 | page_pde_offset = (__PAGE_OFFSET >> 20); |
| 234 | 233 | ||
| 235 | movl $pa(__brk_base), %edi | 234 | movl $pa(__brk_base), %edi |
| 236 | movl $pa(swapper_pg_dir), %edx | 235 | movl $pa(initial_page_table), %edx |
| 237 | movl $PTE_IDENT_ATTR, %eax | 236 | movl $PTE_IDENT_ATTR, %eax |
| 238 | 10: | 237 | 10: |
| 239 | leal PDE_IDENT_ATTR(%edi),%ecx /* Create PDE entry */ | 238 | leal PDE_IDENT_ATTR(%edi),%ecx /* Create PDE entry */ |
| @@ -257,8 +256,8 @@ page_pde_offset = (__PAGE_OFFSET >> 20); | |||
| 257 | movl %eax, pa(max_pfn_mapped) | 256 | movl %eax, pa(max_pfn_mapped) |
| 258 | 257 | ||
| 259 | /* Do early initialization of the fixmap area */ | 258 | /* Do early initialization of the fixmap area */ |
| 260 | movl $pa(swapper_pg_fixmap)+PDE_IDENT_ATTR,%eax | 259 | movl $pa(initial_pg_fixmap)+PDE_IDENT_ATTR,%eax |
| 261 | movl %eax,pa(swapper_pg_dir+0xffc) | 260 | movl %eax,pa(initial_page_table+0xffc) |
| 262 | #endif | 261 | #endif |
| 263 | jmp 3f | 262 | jmp 3f |
| 264 | /* | 263 | /* |
| @@ -334,7 +333,7 @@ ENTRY(startup_32_smp) | |||
| 334 | /* | 333 | /* |
| 335 | * Enable paging | 334 | * Enable paging |
| 336 | */ | 335 | */ |
| 337 | movl pa(initial_page_table), %eax | 336 | movl $pa(initial_page_table), %eax |
| 338 | movl %eax,%cr3 /* set the page table pointer.. */ | 337 | movl %eax,%cr3 /* set the page table pointer.. */ |
| 339 | movl %cr0,%eax | 338 | movl %cr0,%eax |
| 340 | orl $X86_CR0_PG,%eax | 339 | orl $X86_CR0_PG,%eax |
| @@ -614,8 +613,6 @@ ignore_int: | |||
| 614 | .align 4 | 613 | .align 4 |
| 615 | ENTRY(initial_code) | 614 | ENTRY(initial_code) |
| 616 | .long i386_start_kernel | 615 | .long i386_start_kernel |
