aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/common.c
diff options
context:
space:
mode:
authorBrian Gerst <brgerst@gmail.com>2009-01-21 03:26:05 -0500
committerTejun Heo <tj@kernel.org>2009-01-21 03:26:05 -0500
commit06deef892c7327992434917fb6592c233430803d (patch)
tree9f9c1b9615eaaac3cd0cc49feacf17d92b727e4e /arch/x86/kernel/cpu/common.c
parent67e68bde02fe783efc2ce2ca31bdb992f5235f8d (diff)
x86: clean up gdt_page definition
Impact: cleanup && more compact percpu area layout with future changes Move 64-bit GDT to page-aligned section and clean up comment formatting. Signed-off-by: Brian Gerst <brgerst@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
-rw-r--r--arch/x86/kernel/cpu/common.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 3887fcf6e519..a8f0dedcb0cc 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -63,23 +63,23 @@ cpumask_t cpu_sibling_setup_map;
63 63
64static struct cpu_dev *this_cpu __cpuinitdata; 64static struct cpu_dev *this_cpu __cpuinitdata;
65 65
66DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
66#ifdef CONFIG_X86_64 67#ifdef CONFIG_X86_64
67/* We need valid kernel segments for data and code in long mode too 68 /*
68 * IRET will check the segment types kkeil 2000/10/28 69 * We need valid kernel segments for data and code in long mode too
69 * Also sysret mandates a special GDT layout 70 * IRET will check the segment types kkeil 2000/10/28
70 */ 71 * Also sysret mandates a special GDT layout
71/* The TLS descriptors are currently at a different place compared to i386. 72 *
72 Hopefully nobody expects them at a fixed place (Wine?) */ 73 * The TLS descriptors are currently at a different place compared to i386.
73DEFINE_PER_CPU(struct gdt_page, gdt_page) = { .gdt = { 74 * Hopefully nobody expects them at a fixed place (Wine?)
75 */
74 [GDT_ENTRY_KERNEL32_CS] = { { { 0x0000ffff, 0x00cf9b00 } } }, 76 [GDT_ENTRY_KERNEL32_CS] = { { { 0x0000ffff, 0x00cf9b00 } } },
75 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00af9b00 } } }, 77 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00af9b00 } } },
76 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9300 } } }, 78 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9300 } } },
77 [GDT_ENTRY_DEFAULT_USER32_CS] = { { { 0x0000ffff, 0x00cffb00 } } }, 79 [GDT_ENTRY_DEFAULT_USER32_CS] = { { { 0x0000ffff, 0x00cffb00 } } },
78 [GDT_ENTRY_DEFAULT_USER_DS] = { { { 0x0000ffff, 0x00cff300 } } }, 80 [GDT_ENTRY_DEFAULT_USER_DS] = { { { 0x0000ffff, 0x00cff300 } } },
79 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00affb00 } } }, 81 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00affb00 } } },
80} };
81#else 82#else
82DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
83 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00cf9a00 } } }, 83 [GDT_ENTRY_KERNEL_CS] = { { { 0x0000ffff, 0x00cf9a00 } } },
84 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9200 } } }, 84 [GDT_ENTRY_KERNEL_DS] = { { { 0x0000ffff, 0x00cf9200 } } },
85 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00cffa00 } } }, 85 [GDT_ENTRY_DEFAULT_USER_CS] = { { { 0x0000ffff, 0x00cffa00 } } },
@@ -112,8 +112,8 @@ DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = {
112 112
113 [GDT_ENTRY_ESPFIX_SS] = { { { 0x00000000, 0x00c09200 } } }, 113 [GDT_ENTRY_ESPFIX_SS] = { { { 0x00000000, 0x00c09200 } } },
114 [GDT_ENTRY_PERCPU] = { { { 0x00000000, 0x00000000 } } }, 114 [GDT_ENTRY_PERCPU] = { { { 0x00000000, 0x00000000 } } },
115} };
116#endif 115#endif
116} };
117EXPORT_PER_CPU_SYMBOL_GPL(gdt_page); 117EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);
118 118
119#ifdef CONFIG_X86_32 119#ifdef CONFIG_X86_32