Commit f0cf5d1a authored by Jan Beulich's avatar Jan Beulich Committed by Linus Torvalds

[PATCH] x86_64: eliminate empty_bad_{page,{pte,pmd}_table}

... as they are no longer needed. Since there were hard-coded numbers in the
file, the patch also adds a mechanism to avoid these (otherwise potential
future changes would again and again require adjusting these numbers).
Signed-Off-By: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0addb142
...@@ -241,104 +241,70 @@ ljumpvector: ...@@ -241,104 +241,70 @@ ljumpvector:
ENTRY(stext) ENTRY(stext)
ENTRY(_stext) ENTRY(_stext)
.org 0x1000 $page = 0
ENTRY(init_level4_pgt) #define NEXT_PAGE(name) \
$page = $page + 1; \
.org $page * 0x1000; \
phys_/**/name = $page * 0x1000 + __PHYSICAL_START; \
ENTRY(name)
NEXT_PAGE(init_level4_pgt)
/* This gets initialized in x86_64_start_kernel */ /* This gets initialized in x86_64_start_kernel */
.fill 512,8,0 .fill 512,8,0
.org 0x2000 NEXT_PAGE(level3_ident_pgt)
ENTRY(level3_ident_pgt) .quad phys_level2_ident_pgt | 0x007
.quad 0x0000000000004007 + __PHYSICAL_START
.fill 511,8,0 .fill 511,8,0
.org 0x3000 NEXT_PAGE(level3_kernel_pgt)
ENTRY(level3_kernel_pgt)
.fill 510,8,0 .fill 510,8,0
/* (2^48-(2*1024*1024*1024)-((2^39)*511))/(2^30) = 510 */ /* (2^48-(2*1024*1024*1024)-((2^39)*511))/(2^30) = 510 */
.quad 0x0000000000005007 + __PHYSICAL_START /* -> level2_kernel_pgt */ .quad phys_level2_kernel_pgt | 0x007
.fill 1,8,0 .fill 1,8,0
.org 0x4000 NEXT_PAGE(level2_ident_pgt)
ENTRY(level2_ident_pgt)
/* 40MB for bootup. */ /* 40MB for bootup. */
.quad 0x0000000000000083 i = 0
.quad 0x0000000000200083 .rept 20
.quad 0x0000000000400083 .quad i << 21 | 0x083
.quad 0x0000000000600083 i = i + 1
.quad 0x0000000000800083 .endr
.quad 0x0000000000A00083
.quad 0x0000000000C00083
.quad 0x0000000000E00083
.quad 0x0000000001000083
.quad 0x0000000001200083
.quad 0x0000000001400083
.quad 0x0000000001600083
.quad 0x0000000001800083
.quad 0x0000000001A00083
.quad 0x0000000001C00083
.quad 0x0000000001E00083
.quad 0x0000000002000083
.quad 0x0000000002200083
.quad 0x0000000002400083
.quad 0x0000000002600083
/* Temporary mappings for the super early allocator in arch/x86_64/mm/init.c */ /* Temporary mappings for the super early allocator in arch/x86_64/mm/init.c */
.globl temp_boot_pmds .globl temp_boot_pmds
temp_boot_pmds: temp_boot_pmds:
.fill 492,8,0 .fill 492,8,0
.org 0x5000 NEXT_PAGE(level2_kernel_pgt)
ENTRY(level2_kernel_pgt)
/* 40MB kernel mapping. The kernel code cannot be bigger than that. /* 40MB kernel mapping. The kernel code cannot be bigger than that.
When you change this change KERNEL_TEXT_SIZE in page.h too. */ When you change this change KERNEL_TEXT_SIZE in page.h too. */
/* (2^48-(2*1024*1024*1024)-((2^39)*511)-((2^30)*510)) = 0 */ /* (2^48-(2*1024*1024*1024)-((2^39)*511)-((2^30)*510)) = 0 */
.quad 0x0000000000000183 i = 0
.quad 0x0000000000200183 .rept 20
.quad 0x0000000000400183 .quad i << 21 | 0x183
.quad 0x0000000000600183 i = i + 1
.quad 0x0000000000800183 .endr
.quad 0x0000000000A00183
.quad 0x0000000000C00183
.quad 0x0000000000E00183
.quad 0x0000000001000183
.quad 0x0000000001200183
.quad 0x0000000001400183
.quad 0x0000000001600183
.quad 0x0000000001800183
.quad 0x0000000001A00183
.quad 0x0000000001C00183
.quad 0x0000000001E00183
.quad 0x0000000002000183
.quad 0x0000000002200183
.quad 0x0000000002400183
.quad 0x0000000002600183
/* Module mapping starts here */ /* Module mapping starts here */
.fill 492,8,0 .fill 492,8,0
.org 0x6000 NEXT_PAGE(empty_zero_page)
ENTRY(empty_zero_page)
.org 0x7000
ENTRY(empty_bad_page)
.org 0x8000 NEXT_PAGE(level3_physmem_pgt)
ENTRY(empty_bad_pte_table) .quad phys_level2_kernel_pgt | 0x007 /* so that __va works even before pagetable_init */
.fill 511,8,0
.org 0x9000 #undef NEXT_PAGE
ENTRY(empty_bad_pmd_table)
.org 0xa000 .data
ENTRY(level3_physmem_pgt)
.quad 0x0000000000005007 + __PHYSICAL_START /* -> level2_kernel_pgt (so that __va works even before pagetable_init) */
.org 0xb000
#ifdef CONFIG_ACPI_SLEEP #ifdef CONFIG_ACPI_SLEEP
.align PAGE_SIZE
ENTRY(wakeup_level4_pgt) ENTRY(wakeup_level4_pgt)
.quad 0x0000000000002007 + __PHYSICAL_START /* -> level3_ident_pgt */ .quad phys_level3_ident_pgt | 0x007
.fill 255,8,0 .fill 255,8,0
.quad 0x000000000000a007 + __PHYSICAL_START .quad phys_level3_physmem_pgt | 0x007
.fill 254,8,0 .fill 254,8,0
/* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
.quad 0x0000000000003007 + __PHYSICAL_START /* -> level3_kernel_pgt */ .quad phys_level3_kernel_pgt | 0x007
#endif #endif
#ifndef CONFIG_HOTPLUG_CPU #ifndef CONFIG_HOTPLUG_CPU
...@@ -352,12 +318,12 @@ ENTRY(wakeup_level4_pgt) ...@@ -352,12 +318,12 @@ ENTRY(wakeup_level4_pgt)
*/ */
.align PAGE_SIZE .align PAGE_SIZE
ENTRY(boot_level4_pgt) ENTRY(boot_level4_pgt)
.quad 0x0000000000002007 + __PHYSICAL_START /* -> level3_ident_pgt */ .quad phys_level3_ident_pgt | 0x007
.fill 255,8,0 .fill 255,8,0
.quad 0x000000000000a007 + __PHYSICAL_START .quad phys_level3_physmem_pgt | 0x007
.fill 254,8,0 .fill 254,8,0
/* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
.quad 0x0000000000003007 + __PHYSICAL_START /* -> level3_kernel_pgt */ .quad phys_level3_kernel_pgt | 0x007
.data .data
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment