]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SPARC64]: Fix build regressions added by dr-cpu changes.
authorDavid S. Miller <davem@sunset.davemloft.net>
Sat, 14 Jul 2007 07:45:16 +0000 (00:45 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 16 Jul 2007 11:04:49 +0000 (04:04 -0700)
Do not select HOTPLUG_CPU from SUN_LDOMS, that causes
HOTPLUG_CPU to be selected even on non-SMP which is
illegal.

Only build hvtramp.o when SMP, just like trampoline.o

Protect dr-cpu code in ds.c with HOTPLUG_CPU.

Likewise move ldom_startcpu_cpuid() to smp.c and protect
it and the call site with SUN_LDOMS && HOTPLUG_CPU.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/Kconfig
arch/sparc64/kernel/Makefile
arch/sparc64/kernel/ds.c
arch/sparc64/kernel/smp.c
include/asm-sparc64/ldc.h

index 3c2e3397caf88489921526e64773a2db5bf79f5d..b84b6af1241ef55ae943db3fa7c0828164a12132 100644 (file)
@@ -316,7 +316,6 @@ config SUN_IO
 
 config SUN_LDOMS
        bool "Sun Logical Domains support"
-       select HOTPLUG_CPU
        help
          Say Y here is you want to support virtual devices via
          Logical Domains.
index 62db93c148cd157349e3c82fc1b8051f9b81125f..b66876bf410c489391f20251daa4401843465f9e 100644 (file)
@@ -12,14 +12,13 @@ obj-y               := process.o setup.o cpu.o idprom.o \
                   irq.o ptrace.o time.o sys_sparc.o signal.o \
                   unaligned.o central.o pci.o starfire.o semaphore.o \
                   power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \
-                  visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o \
-                  hvtramp.o
+                  visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o
 
 obj-$(CONFIG_STACKTRACE) += stacktrace.o
 obj-$(CONFIG_PCI)       += ebus.o isa.o pci_common.o pci_iommu.o \
                            pci_psycho.o pci_sabre.o pci_schizo.o \
                            pci_sun4v.o pci_sun4v_asm.o pci_fire.o
-obj-$(CONFIG_SMP)       += smp.o trampoline.o
+obj-$(CONFIG_SMP)       += smp.o trampoline.o hvtramp.o
 obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o
 obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o
 obj-$(CONFIG_BINFMT_AOUT32) += binfmt_aout32.o
index b82c03a25d9c4f400c92c2b82929025001c7d35e..2e4114fba1428e5aa511a5dbbd31d14178ca3af9 100644 (file)
@@ -148,9 +148,11 @@ static void domain_shutdown_data(struct ldc_channel *lp,
 static void domain_panic_data(struct ldc_channel *lp,
                              struct ds_cap_state *cp,
                              void *buf, int len);
+#ifdef CONFIG_HOTPLUG_CPU
 static void dr_cpu_data(struct ldc_channel *lp,
                        struct ds_cap_state *cp,
                        void *buf, int len);
+#endif
 static void ds_pri_data(struct ldc_channel *lp,
                        struct ds_cap_state *cp,
                        void *buf, int len);
@@ -171,10 +173,12 @@ struct ds_cap_state ds_states[] = {
                .service_id     = "domain-panic",
                .data           = domain_panic_data,
        },
+#ifdef CONFIG_HOTPLUG_CPU
        {
                .service_id     = "dr-cpu",
                .data           = dr_cpu_data,
        },
+#endif
        {
                .service_id     = "pri",
                .data           = ds_pri_data,
@@ -355,6 +359,7 @@ static void domain_panic_data(struct ldc_channel *lp,
        panic("PANIC requested by LDOM manager.");
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
 struct dr_cpu_tag {
        __u64                           req_num;
        __u32                           type;
@@ -395,54 +400,6 @@ static unsigned long kimage_addr_to_ra(void *p)
        return kern_base + (val - KERNBASE);
 }
 
-void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg)
-{
-       extern unsigned long sparc64_ttable_tl0;
-       extern unsigned long kern_locked_tte_data;
-       extern int bigkernel;
-       struct hvtramp_descr *hdesc;
-       unsigned long trampoline_ra;
-       struct trap_per_cpu *tb;
-       u64 tte_vaddr, tte_data;
-       unsigned long hv_err;
-
-       hdesc = kzalloc(sizeof(*hdesc), GFP_KERNEL);
-       if (!hdesc) {
-               printk(KERN_ERR PFX "ldom_startcpu_cpuid: Cannot allocate "
-                      "hvtramp_descr.\n");
-               return;
-       }
-
-       hdesc->cpu = cpu;
-       hdesc->num_mappings = (bigkernel ? 2 : 1);
-
-       tb = &trap_block[cpu];
-       tb->hdesc = hdesc;
-
-       hdesc->fault_info_va = (unsigned long) &tb->fault_info;
-       hdesc->fault_info_pa = kimage_addr_to_ra(&tb->fault_info);
-
-       hdesc->thread_reg = thread_reg;
-
-       tte_vaddr = (unsigned long) KERNBASE;
-       tte_data = kern_locked_tte_data;
-
-       hdesc->maps[0].vaddr = tte_vaddr;
-       hdesc->maps[0].tte   = tte_data;
-       if (bigkernel) {
-               tte_vaddr += 0x400000;
-               tte_data  += 0x400000;
-               hdesc->maps[1].vaddr = tte_vaddr;
-               hdesc->maps[1].tte   = tte_data;
-       }
-
-       trampoline_ra = kimage_addr_to_ra(hv_cpu_startup);
-
-       hv_err = sun4v_cpu_start(cpu, trampoline_ra,
-                                kimage_addr_to_ra(&sparc64_ttable_tl0),
-                                __pa(hdesc));
-}
-
 /* DR cpu requests get queued onto the work list by the
  * dr_cpu_data() callback.  The list is protected by
  * ds_lock, and processed by dr_cpu_process() in order.
@@ -704,6 +661,7 @@ static void dr_cpu_data(struct ldc_channel *lp,
                schedule_work(&dr_cpu_work);
        }
 }
+#endif
 
 struct ds_pri_msg {
        __u64                           req_num;
index 315eef0869bd08538df498a6eabcf8ef3328a83b..833b284616a48a2396152c4501d490bfa6065d89 100644 (file)
@@ -281,6 +281,56 @@ static void smp_synchronize_one_tick(int cpu)
        spin_unlock_irqrestore(&itc_sync_lock, flags);
 }
 
+#if defined(CONFIG_SUN_LDOMS) && defined(CONFIG_HOTPLUG_CPU)
+static void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg)
+{
+       extern unsigned long sparc64_ttable_tl0;
+       extern unsigned long kern_locked_tte_data;
+       extern int bigkernel;
+       struct hvtramp_descr *hdesc;
+       unsigned long trampoline_ra;
+       struct trap_per_cpu *tb;
+       u64 tte_vaddr, tte_data;
+       unsigned long hv_err;
+
+       hdesc = kzalloc(sizeof(*hdesc), GFP_KERNEL);
+       if (!hdesc) {
+               printk(KERN_ERR PFX "ldom_startcpu_cpuid: Cannot allocate "
+                      "hvtramp_descr.\n");
+               return;
+       }
+
+       hdesc->cpu = cpu;
+       hdesc->num_mappings = (bigkernel ? 2 : 1);
+
+       tb = &trap_block[cpu];
+       tb->hdesc = hdesc;
+
+       hdesc->fault_info_va = (unsigned long) &tb->fault_info;
+       hdesc->fault_info_pa = kimage_addr_to_ra(&tb->fault_info);
+
+       hdesc->thread_reg = thread_reg;
+
+       tte_vaddr = (unsigned long) KERNBASE;
+       tte_data = kern_locked_tte_data;
+
+       hdesc->maps[0].vaddr = tte_vaddr;
+       hdesc->maps[0].tte   = tte_data;
+       if (bigkernel) {
+               tte_vaddr += 0x400000;
+               tte_data  += 0x400000;
+               hdesc->maps[1].vaddr = tte_vaddr;
+               hdesc->maps[1].tte   = tte_data;
+       }
+
+       trampoline_ra = kimage_addr_to_ra(hv_cpu_startup);
+
+       hv_err = sun4v_cpu_start(cpu, trampoline_ra,
+                                kimage_addr_to_ra(&sparc64_ttable_tl0),
+                                __pa(hdesc));
+}
+#endif
+
 extern void sun4v_init_mondo_queues(int use_bootmem, int cpu, int alloc, int load);
 
 extern unsigned long sparc64_cpu_startup;
@@ -309,7 +359,7 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu)
                /* Alloc the mondo queues, cpu will load them.  */
                sun4v_init_mondo_queues(0, cpu, 1, 0);
 
-#ifdef CONFIG_SUN_LDOMS
+#if defined(CONFIG_SUN_LDOMS) && defined(CONFIG_HOTPLUG_CPU)
                if (ldom_domaining_enabled)
                        ldom_startcpu_cpuid(cpu,
                                            (unsigned long) cpu_new_thread);
index 8d17bd6bd5dbaa964233bd0c0dfb7df467e520f2..bdb524a7b814171b98a42c15ad140bbf45b76d28 100644 (file)
@@ -7,7 +7,6 @@ extern int ldom_domaining_enabled;
 extern void ldom_set_var(const char *var, const char *value);
 extern void ldom_reboot(const char *boot_command);
 extern void ldom_power_off(void);
-extern void ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg);
 
 /* The event handler will be evoked when link state changes
  * or data becomes available on the receive side.