aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/mm/cpu_entry_area.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/x86/mm/cpu_entry_area.c b/arch/x86/mm/cpu_entry_area.c
index 19c6abf9ea31..c2a54f75d335 100644
--- a/arch/x86/mm/cpu_entry_area.c
+++ b/arch/x86/mm/cpu_entry_area.c
@@ -52,10 +52,10 @@ cea_map_percpu_pages(void *cea_vaddr, void *ptr, int pages, pgprot_t prot)
52 cea_set_pte(cea_vaddr, per_cpu_ptr_to_phys(ptr), prot); 52 cea_set_pte(cea_vaddr, per_cpu_ptr_to_phys(ptr), prot);
53} 53}
54 54
55static void __init percpu_setup_debug_store(int cpu) 55static void __init percpu_setup_debug_store(unsigned int cpu)
56{ 56{
57#ifdef CONFIG_CPU_SUP_INTEL 57#ifdef CONFIG_CPU_SUP_INTEL
58 int npages; 58 unsigned int npages;
59 void *cea; 59 void *cea;
60 60
61 if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) 61 if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
@@ -79,8 +79,9 @@ static void __init percpu_setup_debug_store(int cpu)
79} 79}
80 80
81/* Setup the fixmap mappings only once per-processor */ 81/* Setup the fixmap mappings only once per-processor */
82static void __init setup_cpu_entry_area(int cpu) 82static void __init setup_cpu_entry_area(unsigned int cpu)
83{ 83{
84 struct cpu_entry_area *cea = get_cpu_entry_area(cpu);
84#ifdef CONFIG_X86_64 85#ifdef CONFIG_X86_64
85 /* On 64-bit systems, we use a read-only fixmap GDT and TSS. */ 86 /* On 64-bit systems, we use a read-only fixmap GDT and TSS. */
86 pgprot_t gdt_prot = PAGE_KERNEL_RO; 87 pgprot_t gdt_prot = PAGE_KERNEL_RO;
@@ -101,10 +102,9 @@ static void __init setup_cpu_entry_area(int cpu)
101 pgprot_t tss_prot = PAGE_KERNEL; 102 pgprot_t tss_prot = PAGE_KERNEL;
102#endif 103#endif
103 104
104 cea_set_pte(&get_cpu_entry_area(cpu)->gdt, get_cpu_gdt_paddr(cpu), 105 cea_set_pte(&cea->gdt, get_cpu_gdt_paddr(cpu), gdt_prot);
105 gdt_prot);
106 106
107 cea_map_percpu_pages(&get_cpu_entry_area(cpu)->entry_stack_page, 107 cea_map_percpu_pages(&cea->entry_stack_page,
108 per_cpu_ptr(&entry_stack_storage, cpu), 1, 108 per_cpu_ptr(&entry_stack_storage, cpu), 1,
109 PAGE_KERNEL); 109 PAGE_KERNEL);
110 110
@@ -128,19 +128,18 @@ static void __init setup_cpu_entry_area(int cpu)
128 BUILD_BUG_ON((offsetof(struct tss_struct, x86_tss) ^ 128 BUILD_BUG_ON((offsetof(struct tss_struct, x86_tss) ^
129 offsetofend(struct tss_struct, x86_tss)) & PAGE_MASK); 129 offsetofend(struct tss_struct, x86_tss)) & PAGE_MASK);
130 BUILD_BUG_ON(sizeof(struct tss_struct) % PAGE_SIZE != 0); 130 BUILD_BUG_ON(sizeof(struct tss_struct) % PAGE_SIZE != 0);
131 cea_map_percpu_pages(&get_cpu_entry_area(cpu)->tss, 131 cea_map_percpu_pages(&cea->tss, &per_cpu(cpu_tss_rw, cpu),
132 &per_cpu(cpu_tss_rw, cpu),
133 sizeof(struct tss_struct) / PAGE_SIZE, tss_prot); 132 sizeof(struct tss_struct) / PAGE_SIZE, tss_prot);
134 133
135#ifdef CONFIG_X86_32 134#ifdef CONFIG_X86_32
136 per_cpu(cpu_entry_area, cpu) = get_cpu_entry_area(cpu); 135 per_cpu(cpu_entry_area, cpu) = cea;
137#endif 136#endif
138 137
139#ifdef CONFIG_X86_64 138#ifdef CONFIG_X86_64
140 BUILD_BUG_ON(sizeof(exception_stacks) % PAGE_SIZE != 0); 139 BUILD_BUG_ON(sizeof(exception_stacks) % PAGE_SIZE != 0);
141 BUILD_BUG_ON(sizeof(exception_stacks) != 140 BUILD_BUG_ON(sizeof(exception_stacks) !=
142 sizeof(((struct cpu_entry_area *)0)->exception_stacks)); 141 sizeof(((struct cpu_entry_area *)0)->exception_stacks));
143 cea_map_percpu_pages(&get_cpu_entry_area(cpu)->exception_stacks, 142 cea_map_percpu_pages(&cea->exception_stacks,
144 &per_cpu(exception_stacks, cpu), 143 &per_cpu(exception_stacks, cpu),
145 sizeof(exception_stacks) / PAGE_SIZE, PAGE_KERNEL); 144 sizeof(exception_stacks) / PAGE_SIZE, PAGE_KERNEL);
146#endif 145#endif