diff options
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/include/asm/kexec.h | 2 | ||||
-rw-r--r-- | arch/ia64/include/asm/sal.h | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/head.S | 26 | ||||
-rw-r--r-- | arch/ia64/kernel/setup.c | 18 | ||||
-rw-r--r-- | arch/ia64/kernel/smpboot.c | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/vmlinux.lds.S | 3 | ||||
-rw-r--r-- | arch/ia64/mm/contig.c | 10 | ||||
-rw-r--r-- | arch/ia64/mm/discontig.c | 6 |
8 files changed, 55 insertions, 14 deletions
diff --git a/arch/ia64/include/asm/kexec.h b/arch/ia64/include/asm/kexec.h index 541be835fc5a..e1d58f819d78 100644 --- a/arch/ia64/include/asm/kexec.h +++ b/arch/ia64/include/asm/kexec.h | |||
@@ -9,7 +9,7 @@ | |||
9 | /* Maximum address we can use for the control code buffer */ | 9 | /* Maximum address we can use for the control code buffer */ |
10 | #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE | 10 | #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE |
11 | 11 | ||
12 | #define KEXEC_CONTROL_CODE_SIZE (8192 + 8192 + 4096) | 12 | #define KEXEC_CONTROL_PAGE_SIZE (8192 + 8192 + 4096) |
13 | 13 | ||
14 | /* The native architecture */ | 14 | /* The native architecture */ |
15 | #define KEXEC_ARCH KEXEC_ARCH_IA_64 | 15 | #define KEXEC_ARCH KEXEC_ARCH_IA_64 |
diff --git a/arch/ia64/include/asm/sal.h b/arch/ia64/include/asm/sal.h index 89594b442f83..ea310c0812aa 100644 --- a/arch/ia64/include/asm/sal.h +++ b/arch/ia64/include/asm/sal.h | |||
@@ -236,7 +236,7 @@ extern struct ia64_sal_desc_ptc *ia64_ptc_domain_info; | |||
236 | 236 | ||
237 | extern unsigned short sal_revision; /* supported SAL spec revision */ | 237 | extern unsigned short sal_revision; /* supported SAL spec revision */ |
238 | extern unsigned short sal_version; /* SAL version; OEM dependent */ | 238 | extern unsigned short sal_version; /* SAL version; OEM dependent */ |
239 | #define SAL_VERSION_CODE(major, minor) ((BIN2BCD(major) << 8) | BIN2BCD(minor)) | 239 | #define SAL_VERSION_CODE(major, minor) ((bin2bcd(major) << 8) | bin2bcd(minor)) |
240 | 240 | ||
241 | extern const char *ia64_sal_strerror (long status); | 241 | extern const char *ia64_sal_strerror (long status); |
242 | extern void ia64_sal_init (struct ia64_sal_systab *sal_systab); | 242 | extern void ia64_sal_init (struct ia64_sal_systab *sal_systab); |
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S index 41c712917ff7..8bdea8eb62e3 100644 --- a/arch/ia64/kernel/head.S +++ b/arch/ia64/kernel/head.S | |||
@@ -359,7 +359,31 @@ start_ap: | |||
359 | mov ar.rsc=0 // place RSE in enforced lazy mode | 359 | mov ar.rsc=0 // place RSE in enforced lazy mode |
360 | ;; | 360 | ;; |
361 | loadrs // clear the dirty partition | 361 | loadrs // clear the dirty partition |
362 | mov IA64_KR(PER_CPU_DATA)=r0 // clear physical per-CPU base | 362 | movl r19=__phys_per_cpu_start |
363 | mov r18=PERCPU_PAGE_SIZE | ||
364 | ;; | ||
365 | #ifndef CONFIG_SMP | ||
366 | add r19=r19,r18 | ||
367 | ;; | ||
368 | #else | ||
369 | (isAP) br.few 2f | ||
370 | mov r20=r19 | ||
371 | sub r19=r19,r18 | ||
372 | ;; | ||
373 | shr.u r18=r18,3 | ||
374 | 1: | ||
375 | ld8 r21=[r20],8;; | ||
376 | st8[r19]=r21,8 | ||
377 | adds r18=-1,r18;; | ||
378 | cmp4.lt p7,p6=0,r18 | ||
379 | (p7) br.cond.dptk.few 1b | ||
380 | 2: | ||
381 | #endif | ||
382 | tpa r19=r19 | ||
383 | ;; | ||
384 | .pred.rel.mutex isBP,isAP | ||
385 | (isBP) mov IA64_KR(PER_CPU_DATA)=r19 // per-CPU base for cpu0 | ||
386 | (isAP) mov IA64_KR(PER_CPU_DATA)=r0 // clear physical per-CPU base | ||
363 | ;; | 387 | ;; |
364 | mov ar.bspstore=r2 // establish the new RSE stack | 388 | mov ar.bspstore=r2 // establish the new RSE stack |
365 | ;; | 389 | ;; |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 593279f33e96..c27d5b2c182b 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -927,17 +927,19 @@ cpu_init (void) | |||
927 | if (smp_processor_id() == 0) { | 927 | if (smp_processor_id() == 0) { |
928 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); | 928 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); |
929 | cpu_set(0, cpu_core_map[0]); | 929 | cpu_set(0, cpu_core_map[0]); |
930 | } else { | ||
931 | /* | ||
932 | * Set ar.k3 so that assembly code in MCA handler can compute | ||
933 | * physical addresses of per cpu variables with a simple: | ||
934 | * phys = ar.k3 + &per_cpu_var | ||
935 | * and the alt-dtlb-miss handler can set per-cpu mapping into | ||
936 | * the TLB when needed. head.S already did this for cpu0. | ||
937 | */ | ||
938 | ia64_set_kr(IA64_KR_PER_CPU_DATA, | ||
939 | ia64_tpa(cpu_data) - (long) __per_cpu_start); | ||
930 | } | 940 | } |
931 | #endif | 941 | #endif |
932 | 942 | ||
933 | /* | ||
934 | * We set ar.k3 so that assembly code in MCA handler can compute | ||
935 | * physical addresses of per cpu variables with a simple: | ||
936 | * phys = ar.k3 + &per_cpu_var | ||
937 | */ | ||
938 | ia64_set_kr(IA64_KR_PER_CPU_DATA, | ||
939 | ia64_tpa(cpu_data) - (long) __per_cpu_start); | ||
940 | |||
941 | get_max_cacheline_size(); | 943 | get_max_cacheline_size(); |
942 | 944 | ||
943 | /* | 945 | /* |
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index 03f1a9908afc..b39853a292d5 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
@@ -467,7 +467,9 @@ start_secondary (void *unused) | |||
467 | { | 467 | { |
468 | /* Early console may use I/O ports */ | 468 | /* Early console may use I/O ports */ |
469 | ia64_set_kr(IA64_KR_IO_BASE, __pa(ia64_iobase)); | 469 | ia64_set_kr(IA64_KR_IO_BASE, __pa(ia64_iobase)); |
470 | #ifndef CONFIG_PRINTK_TIME | ||
470 | Dprintk("start_secondary: starting CPU 0x%x\n", hard_smp_processor_id()); | 471 | Dprintk("start_secondary: starting CPU 0x%x\n", hard_smp_processor_id()); |
472 | #endif | ||
471 | efi_map_pal_code(); | 473 | efi_map_pal_code(); |
472 | cpu_init(); | 474 | cpu_init(); |
473 | preempt_disable(); | 475 | preempt_disable(); |
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index 5a77206c2492..de71da811cd6 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S | |||
@@ -215,6 +215,9 @@ SECTIONS | |||
215 | /* Per-cpu data: */ | 215 | /* Per-cpu data: */ |
216 | percpu : { } :percpu | 216 | percpu : { } :percpu |
217 | . = ALIGN(PERCPU_PAGE_SIZE); | 217 | . = ALIGN(PERCPU_PAGE_SIZE); |
218 | #ifdef CONFIG_SMP | ||
219 | . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */ | ||
220 | #endif | ||
218 | __phys_per_cpu_start = .; | 221 | __phys_per_cpu_start = .; |
219 | .data.percpu PERCPU_ADDR : AT(__phys_per_cpu_start - LOAD_OFFSET) | 222 | .data.percpu PERCPU_ADDR : AT(__phys_per_cpu_start - LOAD_OFFSET) |
220 | { | 223 | { |
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c index 798bf9835a51..e566ff43884a 100644 --- a/arch/ia64/mm/contig.c +++ b/arch/ia64/mm/contig.c | |||
@@ -163,8 +163,14 @@ per_cpu_init (void) | |||
163 | * get_zeroed_page(). | 163 | * get_zeroed_page(). |
164 | */ | 164 | */ |
165 | if (first_time) { | 165 | if (first_time) { |
166 | void *cpu0_data = __phys_per_cpu_start - PERCPU_PAGE_SIZE; | ||
167 | |||
166 | first_time=0; | 168 | first_time=0; |
167 | for (cpu = 0; cpu < NR_CPUS; cpu++) { | 169 | |
170 | __per_cpu_offset[0] = (char *) cpu0_data - __per_cpu_start; | ||
171 | per_cpu(local_per_cpu_offset, 0) = __per_cpu_offset[0]; | ||
172 | |||
173 | for (cpu = 1; cpu < NR_CPUS; cpu++) { | ||
168 | memcpy(cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start); | 174 | memcpy(cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start); |
169 | __per_cpu_offset[cpu] = (char *) cpu_data - __per_cpu_start; | 175 | __per_cpu_offset[cpu] = (char *) cpu_data - __per_cpu_start; |
170 | cpu_data += PERCPU_PAGE_SIZE; | 176 | cpu_data += PERCPU_PAGE_SIZE; |
@@ -177,7 +183,7 @@ per_cpu_init (void) | |||
177 | static inline void | 183 | static inline void |
178 | alloc_per_cpu_data(void) | 184 | alloc_per_cpu_data(void) |
179 | { | 185 | { |
180 | cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS, | 186 | cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS-1, |
181 | PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); | 187 | PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); |
182 | } | 188 | } |
183 | #else | 189 | #else |
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index d83125e1ed27..78026aabaa7f 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c | |||
@@ -143,7 +143,11 @@ static void *per_cpu_node_setup(void *cpu_data, int node) | |||
143 | int cpu; | 143 | int cpu; |
144 | 144 | ||
145 | for_each_possible_early_cpu(cpu) { | 145 | for_each_possible_early_cpu(cpu) { |
146 | if (node == node_cpuid[cpu].nid) { | 146 | if (cpu == 0) { |
147 | void *cpu0_data = __phys_per_cpu_start - PERCPU_PAGE_SIZE; | ||
148 | __per_cpu_offset[cpu] = (char*)cpu0_data - | ||
149 | __per_cpu_start; | ||
150 | } else if (node == node_cpuid[cpu].nid) { | ||
147 | memcpy(__va(cpu_data), __phys_per_cpu_start, | 151 | memcpy(__va(cpu_data), __phys_per_cpu_start, |
148 | __per_cpu_end - __per_cpu_start); | 152 | __per_cpu_end - __per_cpu_start); |
149 | __per_cpu_offset[cpu] = (char*)__va(cpu_data) - | 153 | __per_cpu_offset[cpu] = (char*)__va(cpu_data) - |