diff options
author | Jan Beulich <jbeulich@novell.com> | 2006-03-25 10:30:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 12:10:54 -0500 |
commit | e57113bc1ff591005ec0b0fb4885d97c01de73d8 (patch) | |
tree | 5e383dc4bdb5decf06adecca6da76fec6cbaa7d8 /arch | |
parent | 1f50249e940baa7133e0bdb32cd564bb3ba28456 (diff) |
[PATCH] x86_64: miscellaneous cleanup
- adjust limits of GDT/IDT pseudo-descriptors (some were off by one)
- move empty_zero_page into .bss.page_aligned
- move cpu_gdt_table into .data.page_aligned
- move idt_table into .bss
- align inital_code and init_rsp
- eliminate pointless (re-)declaration of idt_table in traps.c
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86_64/kernel/head.S | 25 | ||||
-rw-r--r-- | arch/x86_64/kernel/setup64.c | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/traps.c | 2 |
3 files changed, 15 insertions, 14 deletions
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S index 02fc7fa0ea28..0cddcc038422 100644 --- a/arch/x86_64/kernel/head.S +++ b/arch/x86_64/kernel/head.S | |||
@@ -192,7 +192,8 @@ startup_64: | |||
192 | movq initial_code(%rip),%rax | 192 | movq initial_code(%rip),%rax |
193 | jmp *%rax | 193 | jmp *%rax |
194 | 194 | ||
195 | /* SMP bootup changes these two */ | 195 | /* SMP bootup changes these two */ |
196 | .align 8 | ||
196 | .globl initial_code | 197 | .globl initial_code |
197 | initial_code: | 198 | initial_code: |
198 | .quad x86_64_start_kernel | 199 | .quad x86_64_start_kernel |
@@ -237,7 +238,7 @@ ENTRY(no_long_mode) | |||
237 | .org 0xf00 | 238 | .org 0xf00 |
238 | .globl pGDT32 | 239 | .globl pGDT32 |
239 | pGDT32: | 240 | pGDT32: |
240 | .word gdt_end-cpu_gdt_table | 241 | .word gdt_end-cpu_gdt_table-1 |
241 | .long cpu_gdt_table-__START_KERNEL_map | 242 | .long cpu_gdt_table-__START_KERNEL_map |
242 | 243 | ||
243 | .org 0xf10 | 244 | .org 0xf10 |
@@ -293,8 +294,6 @@ NEXT_PAGE(level2_kernel_pgt) | |||
293 | /* Module mapping starts here */ | 294 | /* Module mapping starts here */ |
294 | .fill 492,8,0 | 295 | .fill 492,8,0 |
295 | 296 | ||
296 | NEXT_PAGE(empty_zero_page) | ||
297 | |||
298 | NEXT_PAGE(level3_physmem_pgt) | 297 | NEXT_PAGE(level3_physmem_pgt) |
299 | .quad phys_level2_kernel_pgt | 0x007 /* so that __va works even before pagetable_init */ | 298 | .quad phys_level2_kernel_pgt | 0x007 /* so that __va works even before pagetable_init */ |
300 | .fill 511,8,0 | 299 | .fill 511,8,0 |
@@ -337,7 +336,7 @@ ENTRY(boot_level4_pgt) | |||
337 | .align 16 | 336 | .align 16 |
338 | .globl cpu_gdt_descr | 337 | .globl cpu_gdt_descr |
339 | cpu_gdt_descr: | 338 | cpu_gdt_descr: |
340 | .word gdt_end-cpu_gdt_table | 339 | .word gdt_end-cpu_gdt_table-1 |
341 | gdt: | 340 | gdt: |
342 | .quad cpu_gdt_table | 341 | .quad cpu_gdt_table |
343 | #ifdef CONFIG_SMP | 342 | #ifdef CONFIG_SMP |
@@ -352,7 +351,8 @@ gdt: | |||
352 | * Also sysret mandates a special GDT layout | 351 | * Also sysret mandates a special GDT layout |
353 | */ | 352 | */ |
354 | 353 | ||
355 | .align PAGE_SIZE | 354 | .section .data.page_aligned, "aw" |
355 | .align PAGE_SIZE | ||
356 | 356 | ||
357 | /* The TLS descriptors are currently at a different place compared to i386. | 357 | /* The TLS descriptors are currently at a different place compared to i386. |
358 | Hopefully nobody expects them at a fixed place (Wine?) */ | 358 | Hopefully nobody expects them at a fixed place (Wine?) */ |
@@ -378,9 +378,12 @@ gdt_end: | |||
378 | /* zero the remaining page */ | 378 | /* zero the remaining page */ |
379 | .fill PAGE_SIZE / 8 - GDT_ENTRIES,8,0 | 379 | .fill PAGE_SIZE / 8 - GDT_ENTRIES,8,0 |
380 | 380 | ||
381 | ENTRY(idt_table) | 381 | .section .bss, "aw", @nobits |
382 | .rept 256 | 382 | .align L1_CACHE_BYTES |
383 | .quad 0 | 383 | ENTRY(idt_table) |
384 | .quad 0 | 384 | .skip 256 * 16 |
385 | .endr | ||
386 | 385 | ||
386 | .section .bss.page_aligned, "aw", @nobits | ||
387 | .align PAGE_SIZE | ||
388 | ENTRY(empty_zero_page) | ||
389 | .skip PAGE_SIZE | ||
diff --git a/arch/x86_64/kernel/setup64.c b/arch/x86_64/kernel/setup64.c index 044587812b05..356b462cb0ec 100644 --- a/arch/x86_64/kernel/setup64.c +++ b/arch/x86_64/kernel/setup64.c | |||
@@ -33,7 +33,7 @@ cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE; | |||
33 | struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly; | 33 | struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly; |
34 | struct x8664_pda boot_cpu_pda[NR_CPUS] __cacheline_aligned; | 34 | struct x8664_pda boot_cpu_pda[NR_CPUS] __cacheline_aligned; |
35 | 35 | ||
36 | struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table }; | 36 | struct desc_ptr idt_descr = { 256 * 16 - 1, (unsigned long) idt_table }; |
37 | 37 | ||
38 | char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned"))); | 38 | char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned"))); |
39 | 39 | ||
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index 05dbbf40ccf5..7b148309c529 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c | |||
@@ -47,8 +47,6 @@ | |||
47 | #include <asm/proto.h> | 47 | #include <asm/proto.h> |
48 | #include <asm/nmi.h> | 48 | #include <asm/nmi.h> |
49 | 49 | ||
50 | extern struct gate_struct idt_table[256]; | ||
51 | |||
52 | asmlinkage void divide_error(void); | 50 | asmlinkage void divide_error(void); |
53 | asmlinkage void debug(void); | 51 | asmlinkage void debug(void); |
54 | asmlinkage void nmi(void); | 52 | asmlinkage void nmi(void); |