diff options
Diffstat (limited to 'arch/x86_64/kernel')
-rw-r--r-- | arch/x86_64/kernel/head.S | 108 |
1 files changed, 37 insertions, 71 deletions
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S index 38fc3d5112e7..692c737feddb 100644 --- a/arch/x86_64/kernel/head.S +++ b/arch/x86_64/kernel/head.S | |||
@@ -241,104 +241,70 @@ ljumpvector: | |||
241 | ENTRY(stext) | 241 | ENTRY(stext) |
242 | ENTRY(_stext) | 242 | ENTRY(_stext) |
243 | 243 | ||
244 | .org 0x1000 | 244 | $page = 0 |
245 | ENTRY(init_level4_pgt) | 245 | #define NEXT_PAGE(name) \ |
246 | $page = $page + 1; \ | ||
247 | .org $page * 0x1000; \ | ||
248 | phys_/**/name = $page * 0x1000 + __PHYSICAL_START; \ | ||
249 | ENTRY(name) | ||
250 | |||
251 | NEXT_PAGE(init_level4_pgt) | ||
246 | /* This gets initialized in x86_64_start_kernel */ | 252 | /* This gets initialized in x86_64_start_kernel */ |
247 | .fill 512,8,0 | 253 | .fill 512,8,0 |
248 | 254 | ||
249 | .org 0x2000 | 255 | NEXT_PAGE(level3_ident_pgt) |
250 | ENTRY(level3_ident_pgt) | 256 | .quad phys_level2_ident_pgt | 0x007 |
251 | .quad 0x0000000000004007 + __PHYSICAL_START | ||
252 | .fill 511,8,0 | 257 | .fill 511,8,0 |
253 | 258 | ||
254 | .org 0x3000 | 259 | NEXT_PAGE(level3_kernel_pgt) |
255 | ENTRY(level3_kernel_pgt) | ||
256 | .fill 510,8,0 | 260 | .fill 510,8,0 |
257 | /* (2^48-(2*1024*1024*1024)-((2^39)*511))/(2^30) = 510 */ | 261 | /* (2^48-(2*1024*1024*1024)-((2^39)*511))/(2^30) = 510 */ |
258 | .quad 0x0000000000005007 + __PHYSICAL_START /* -> level2_kernel_pgt */ | 262 | .quad phys_level2_kernel_pgt | 0x007 |
259 | .fill 1,8,0 | 263 | .fill 1,8,0 |
260 | 264 | ||
261 | .org 0x4000 | 265 | NEXT_PAGE(level2_ident_pgt) |
262 | ENTRY(level2_ident_pgt) | ||
263 | /* 40MB for bootup. */ | 266 | /* 40MB for bootup. */ |
264 | .quad 0x0000000000000083 | 267 | i = 0 |
265 | .quad 0x0000000000200083 | 268 | .rept 20 |
266 | .quad 0x0000000000400083 | 269 | .quad i << 21 | 0x083 |
267 | .quad 0x0000000000600083 | 270 | i = i + 1 |
268 | .quad 0x0000000000800083 | 271 | .endr |
269 | .quad 0x0000000000A00083 | ||
270 | .quad 0x0000000000C00083 | ||
271 | .quad 0x0000000000E00083 | ||
272 | .quad 0x0000000001000083 | ||
273 | .quad 0x0000000001200083 | ||
274 | .quad 0x0000000001400083 | ||
275 | .quad 0x0000000001600083 | ||
276 | .quad 0x0000000001800083 | ||
277 | .quad 0x0000000001A00083 | ||
278 | .quad 0x0000000001C00083 | ||
279 | .quad 0x0000000001E00083 | ||
280 | .quad 0x0000000002000083 | ||
281 | .quad 0x0000000002200083 | ||
282 | .quad 0x0000000002400083 | ||
283 | .quad 0x0000000002600083 | ||
284 | /* Temporary mappings for the super early allocator in arch/x86_64/mm/init.c */ | 272 | /* Temporary mappings for the super early allocator in arch/x86_64/mm/init.c */ |
285 | .globl temp_boot_pmds | 273 | .globl temp_boot_pmds |
286 | temp_boot_pmds: | 274 | temp_boot_pmds: |
287 | .fill 492,8,0 | 275 | .fill 492,8,0 |
288 | 276 | ||
289 | .org 0x5000 | 277 | NEXT_PAGE(level2_kernel_pgt) |
290 | ENTRY(level2_kernel_pgt) | ||
291 | /* 40MB kernel mapping. The kernel code cannot be bigger than that. | 278 | /* 40MB kernel mapping. The kernel code cannot be bigger than that. |
292 | When you change this change KERNEL_TEXT_SIZE in page.h too. */ | 279 | When you change this change KERNEL_TEXT_SIZE in page.h too. */ |
293 | /* (2^48-(2*1024*1024*1024)-((2^39)*511)-((2^30)*510)) = 0 */ | 280 | /* (2^48-(2*1024*1024*1024)-((2^39)*511)-((2^30)*510)) = 0 */ |
294 | .quad 0x0000000000000183 | 281 | i = 0 |
295 | .quad 0x0000000000200183 | 282 | .rept 20 |
296 | .quad 0x0000000000400183 | 283 | .quad i << 21 | 0x183 |
297 | .quad 0x0000000000600183 | 284 | i = i + 1 |
298 | .quad 0x0000000000800183 | 285 | .endr |
299 | .quad 0x0000000000A00183 | ||
300 | .quad 0x0000000000C00183 | ||
301 | .quad 0x0000000000E00183 | ||
302 | .quad 0x0000000001000183 | ||
303 | .quad 0x0000000001200183 | ||
304 | .quad 0x0000000001400183 | ||
305 | .quad 0x0000000001600183 | ||
306 | .quad 0x0000000001800183 | ||
307 | .quad 0x0000000001A00183 | ||
308 | .quad 0x0000000001C00183 | ||
309 | .quad 0x0000000001E00183 | ||
310 | .quad 0x0000000002000183 | ||
311 | .quad 0x0000000002200183 | ||
312 | .quad 0x0000000002400183 | ||
313 | .quad 0x0000000002600183 | ||
314 | /* Module mapping starts here */ | 286 | /* Module mapping starts here */ |
315 | .fill 492,8,0 | 287 | .fill 492,8,0 |
316 | 288 | ||
317 | .org 0x6000 | 289 | NEXT_PAGE(empty_zero_page) |
318 | ENTRY(empty_zero_page) | ||
319 | |||
320 | .org 0x7000 | ||
321 | ENTRY(empty_bad_page) | ||
322 | 290 | ||
323 | .org 0x8000 | 291 | NEXT_PAGE(level3_physmem_pgt) |
324 | ENTRY(empty_bad_pte_table) | 292 | .quad phys_level2_kernel_pgt | 0x007 /* so that __va works even before pagetable_init */ |
293 | .fill 511,8,0 | ||
325 | 294 | ||
326 | .org 0x9000 | 295 | #undef NEXT_PAGE |
327 | ENTRY(empty_bad_pmd_table) | ||
328 | 296 | ||
329 | .org 0xa000 | 297 | .data |
330 | ENTRY(level3_physmem_pgt) | ||
331 | .quad 0x0000000000005007 + __PHYSICAL_START /* -> level2_kernel_pgt (so that __va works even before pagetable_init) */ | ||
332 | 298 | ||
333 | .org 0xb000 | ||
334 | #ifdef CONFIG_ACPI_SLEEP | 299 | #ifdef CONFIG_ACPI_SLEEP |
300 | .align PAGE_SIZE | ||
335 | ENTRY(wakeup_level4_pgt) | 301 | ENTRY(wakeup_level4_pgt) |
336 | .quad 0x0000000000002007 + __PHYSICAL_START /* -> level3_ident_pgt */ | 302 | .quad phys_level3_ident_pgt | 0x007 |
337 | .fill 255,8,0 | 303 | .fill 255,8,0 |
338 | .quad 0x000000000000a007 + __PHYSICAL_START | 304 | .quad phys_level3_physmem_pgt | 0x007 |
339 | .fill 254,8,0 | 305 | .fill 254,8,0 |
340 | /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ | 306 | /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ |
341 | .quad 0x0000000000003007 + __PHYSICAL_START /* -> level3_kernel_pgt */ | 307 | .quad phys_level3_kernel_pgt | 0x007 |
342 | #endif | 308 | #endif |
343 | 309 | ||
344 | #ifndef CONFIG_HOTPLUG_CPU | 310 | #ifndef CONFIG_HOTPLUG_CPU |
@@ -352,12 +318,12 @@ ENTRY(wakeup_level4_pgt) | |||
352 | */ | 318 | */ |
353 | .align PAGE_SIZE | 319 | .align PAGE_SIZE |
354 | ENTRY(boot_level4_pgt) | 320 | ENTRY(boot_level4_pgt) |
355 | .quad 0x0000000000002007 + __PHYSICAL_START /* -> level3_ident_pgt */ | 321 | .quad phys_level3_ident_pgt | 0x007 |
356 | .fill 255,8,0 | 322 | .fill 255,8,0 |
357 | .quad 0x000000000000a007 + __PHYSICAL_START | 323 | .quad phys_level3_physmem_pgt | 0x007 |
358 | .fill 254,8,0 | 324 | .fill 254,8,0 |
359 | /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ | 325 | /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ |
360 | .quad 0x0000000000003007 + __PHYSICAL_START /* -> level3_kernel_pgt */ | 326 | .quad phys_level3_kernel_pgt | 0x007 |
361 | 327 | ||
362 | .data | 328 | .data |
363 | 329 | ||