These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / xen / cpu_hotplug.c
index cc6513a..5676aef 100644 (file)
 static void enable_hotplug_cpu(int cpu)
 {
        if (!cpu_present(cpu))
-               arch_register_cpu(cpu);
+               xen_arch_register_cpu(cpu);
 
        set_cpu_present(cpu, true);
 }
 
 static void disable_hotplug_cpu(int cpu)
 {
+       if (cpu_online(cpu)) {
+               lock_device_hotplug();
+               device_offline(get_cpu_device(cpu));
+               unlock_device_hotplug();
+       }
        if (cpu_present(cpu))
-               arch_unregister_cpu(cpu);
+               xen_arch_unregister_cpu(cpu);
 
        set_cpu_present(cpu, false);
 }
@@ -55,7 +60,6 @@ static void vcpu_hotplug(unsigned int cpu)
                enable_hotplug_cpu(cpu);
                break;
        case 0:
-               (void)cpu_down(cpu);
                disable_hotplug_cpu(cpu);
                break;
        default:
@@ -102,7 +106,11 @@ static int __init setup_vcpu_hotplug_event(void)
        static struct notifier_block xsn_cpu = {
                .notifier_call = setup_cpu_watcher };
 
+#ifdef CONFIG_X86
        if (!xen_pv_domain())
+#else
+       if (!xen_domain())
+#endif
                return -ENODEV;
 
        register_xenstore_notifier(&xsn_cpu);