[SPARC64]: Do not try to synchronize %stick registers on SUN4V.
[cascardo/linux.git] / arch / sparc64 / kernel / smp.c
index f553264..2dbe008 100644 (file)
@@ -122,8 +122,10 @@ void __init smp_callin(void)
 
        __local_per_cpu_offset = __per_cpu_offset(cpuid);
 
-       if (tlb_type == hypervisor)
+       if (tlb_type == hypervisor) {
                sun4v_register_fault_status();
+               sun4v_ktsb_register();
+       }
 
        __flush_tlb_all();
 
@@ -589,7 +591,7 @@ static void hypervisor_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t
                                       "2" (arg1), "3" (arg2),
                                       "i" (HV_FAST_TRAP)
                                     : "memory");
-               if (likely(func == HV_EOK))
+               if (likely(arg0 == HV_EOK))
                        break;
 
                if (unlikely(++retries > 100)) {
@@ -642,7 +644,7 @@ static void hypervisor_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t
                                               "2" (arg1), "3" (arg2),
                                               "i" (HV_FAST_TRAP)
                                             : "memory");
-                       if (likely(func == HV_EOK))
+                       if (likely(arg0 == HV_EOK))
                                break;
 
                        if (unlikely(++retries > 100)) {
@@ -1276,7 +1278,11 @@ int __devinit __cpu_up(unsigned int cpu)
                if (!cpu_isset(cpu, cpu_online_map)) {
                        ret = -ENODEV;
                } else {
-                       smp_synchronize_one_tick(cpu);
+                       /* On SUN4V, writes to %tick and %stick are
+                        * not allowed.
+                        */
+                       if (tlb_type != hypervisor)
+                               smp_synchronize_one_tick(cpu);
                }
        }
        return ret;