aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/smp.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/smp.c')
-rw-r--r--arch/sparc64/kernel/smp.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index cc454731d879..59f020d69d4c 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -1,6 +1,6 @@
1/* smp.c: Sparc64 SMP support. 1/* smp.c: Sparc64 SMP support.
2 * 2 *
3 * Copyright (C) 1997, 2007 David S. Miller (davem@davemloft.net) 3 * Copyright (C) 1997, 2007, 2008 David S. Miller (davem@davemloft.net)
4 */ 4 */
5 5
6#include <linux/module.h> 6#include <linux/module.h>
@@ -30,6 +30,7 @@
30#include <asm/cpudata.h> 30#include <asm/cpudata.h>
31#include <asm/hvtramp.h> 31#include <asm/hvtramp.h>
32#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/timer.h>
33 34
34#include <asm/irq.h> 35#include <asm/irq.h>
35#include <asm/irq_regs.h> 36#include <asm/irq_regs.h>
@@ -284,14 +285,17 @@ static void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg)
284{ 285{
285 extern unsigned long sparc64_ttable_tl0; 286 extern unsigned long sparc64_ttable_tl0;
286 extern unsigned long kern_locked_tte_data; 287 extern unsigned long kern_locked_tte_data;
287 extern int bigkernel;
288 struct hvtramp_descr *hdesc; 288 struct hvtramp_descr *hdesc;
289 unsigned long trampoline_ra; 289 unsigned long trampoline_ra;
290 struct trap_per_cpu *tb; 290 struct trap_per_cpu *tb;
291 u64 tte_vaddr, tte_data; 291 u64 tte_vaddr, tte_data;
292 unsigned long hv_err; 292 unsigned long hv_err;
293 int i;
293 294
294 hdesc = kzalloc(sizeof(*hdesc), GFP_KERNEL); 295 hdesc = kzalloc(sizeof(*hdesc) +
296 (sizeof(struct hvtramp_mapping) *
297 num_kernel_image_mappings - 1),
298 GFP_KERNEL);
295 if (!hdesc) { 299 if (!hdesc) {
296 printk(KERN_ERR "ldom_startcpu_cpuid: Cannot allocate " 300 printk(KERN_ERR "ldom_startcpu_cpuid: Cannot allocate "
297 "hvtramp_descr.\n"); 301 "hvtramp_descr.\n");
@@ -299,7 +303,7 @@ static void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg)
299 } 303 }
300 304
301 hdesc->cpu = cpu; 305 hdesc->cpu = cpu;
302 hdesc->num_mappings = (bigkernel ? 2 : 1); 306 hdesc->num_mappings = num_kernel_image_mappings;
303 307
304 tb = &trap_block[cpu]; 308 tb = &trap_block[cpu];
305 tb->hdesc = hdesc; 309 tb->hdesc = hdesc;
@@ -312,13 +316,11 @@ static void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg)
312 tte_vaddr = (unsigned long) KERNBASE; 316 tte_vaddr = (unsigned long) KERNBASE;
313 tte_data = kern_locked_tte_data; 317 tte_data = kern_locked_tte_data;
314 318
315 hdesc->maps[0].vaddr = tte_vaddr; 319 for (i = 0; i < hdesc->num_mappings; i++) {
316 hdesc->maps[0].tte = tte_data; 320 hdesc->maps[i].vaddr = tte_vaddr;
317 if (bigkernel) { 321 hdesc->maps[i].tte = tte_data;
318 tte_vaddr += 0x400000; 322 tte_vaddr += 0x400000;
319 tte_data += 0x400000; 323 tte_data += 0x400000;
320 hdesc->maps[1].vaddr = tte_vaddr;
321 hdesc->maps[1].tte = tte_data;
322 } 324 }
323 325
324 trampoline_ra = kimage_addr_to_ra(hv_cpu_startup); 326 trampoline_ra = kimage_addr_to_ra(hv_cpu_startup);