diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2009-02-27 16:27:38 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-03-14 20:23:47 -0400 |
commit | ccf3fe02e35f4abca2589f99022cc25084bbd8ae (patch) | |
tree | 3bcf329116b8c689b4da1bb1a0d87bb587d3f3c7 /arch/x86/kernel/head_32.S | |
parent | 5368a2be34b96fda9c05d79424fa63a73ead04ed (diff) |
x86-32: use brk segment for allocating initial kernel pagetable
Impact: use new interface instead of previous ad hoc implementation
Rather than having special purpose init_pg_table_start/end variables
to delimit the kernel pagetable built by head_32.S, just use the brk
mechanism to extend the bss for the new pagetable.
This patch removes init_pg_table_start/end and pg0, defines __brk_base
(which is page-aligned and immediately follows _end), initializes
the brk region to start there, and uses it for the 32-bit pagetable.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/head_32.S')
-rw-r--r-- | arch/x86/kernel/head_32.S | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index c32ca19d591a..db6652710e98 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
@@ -167,7 +167,7 @@ num_subarch_entries = (. - subarch_entries) / 4 | |||
167 | /* | 167 | /* |
168 | * Initialize page tables. This creates a PDE and a set of page | 168 | * Initialize page tables. This creates a PDE and a set of page |
169 | * tables, which are located immediately beyond _end. The variable | 169 | * tables, which are located immediately beyond _end. The variable |
170 | * init_pg_tables_end is set up to point to the first "safe" location. | 170 | * _brk_end is set up to point to the first "safe" location. |
171 | * Mappings are created both at virtual address 0 (identity mapping) | 171 | * Mappings are created both at virtual address 0 (identity mapping) |
172 | * and PAGE_OFFSET for up to _end+sizeof(page tables)+INIT_MAP_BEYOND_END. | 172 | * and PAGE_OFFSET for up to _end+sizeof(page tables)+INIT_MAP_BEYOND_END. |
173 | * | 173 | * |
@@ -190,8 +190,7 @@ default_entry: | |||
190 | 190 | ||
191 | xorl %ebx,%ebx /* %ebx is kept at zero */ | 191 | xorl %ebx,%ebx /* %ebx is kept at zero */ |
192 | 192 | ||
193 | movl $pa(pg0), %edi | 193 | movl $pa(__brk_base), %edi |
194 | movl %edi, pa(init_pg_tables_start) | ||
195 | movl $pa(swapper_pg_pmd), %edx | 194 | movl $pa(swapper_pg_pmd), %edx |
196 | movl $PTE_IDENT_ATTR, %eax | 195 | movl $PTE_IDENT_ATTR, %eax |
197 | 10: | 196 | 10: |
@@ -216,7 +215,8 @@ default_entry: | |||
216 | cmpl %ebp,%eax | 215 | cmpl %ebp,%eax |
217 | jb 10b | 216 | jb 10b |
218 | 1: | 217 | 1: |
219 | movl %edi,pa(init_pg_tables_end) | 218 | addl $__PAGE_OFFSET, %edi |
219 | movl %edi, pa(_brk_end) | ||
220 | shrl $12, %eax | 220 | shrl $12, %eax |
221 | movl %eax, pa(max_pfn_mapped) | 221 | movl %eax, pa(max_pfn_mapped) |
222 | 222 | ||
@@ -227,8 +227,7 @@ default_entry: | |||
227 | 227 | ||
228 | page_pde_offset = (__PAGE_OFFSET >> 20); | 228 | page_pde_offset = (__PAGE_OFFSET >> 20); |
229 | 229 | ||
230 | movl $pa(pg0), %edi | 230 | movl $pa(__brk_base), %edi |
231 | movl %edi, pa(init_pg_tables_start) | ||
232 | movl $pa(swapper_pg_dir), %edx | 231 | movl $pa(swapper_pg_dir), %edx |
233 | movl $PTE_IDENT_ATTR, %eax | 232 | movl $PTE_IDENT_ATTR, %eax |
234 | 10: | 233 | 10: |
@@ -249,7 +248,8 @@ page_pde_offset = (__PAGE_OFFSET >> 20); | |||
249 | leal (INIT_MAP_BEYOND_END+PTE_IDENT_ATTR)(%edi),%ebp | 248 | leal (INIT_MAP_BEYOND_END+PTE_IDENT_ATTR)(%edi),%ebp |
250 | cmpl %ebp,%eax | 249 | cmpl %ebp,%eax |
251 | jb 10b | 250 | jb 10b |
252 | movl %edi,pa(init_pg_tables_end) | 251 | addl $__PAGE_OFFSET, %edi |
252 | movl %edi, pa(_brk_end) | ||
253 | shrl $12, %eax | 253 | shrl $12, %eax |
254 | movl %eax, pa(max_pfn_mapped) | 254 | movl %eax, pa(max_pfn_mapped) |
255 | 255 | ||