]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Revert "x86/paravirt: Set up the virt_spin_lock_key after static keys get initialized"
authorZhenzhong Duan <zhenzhong.duan@oracle.com>
Wed, 26 Jun 2019 08:57:09 +0000 (16:57 +0800)
committerJuergen Gross <jgross@suse.com>
Wed, 17 Jul 2019 06:09:57 +0000 (08:09 +0200)
This reverts commit ca5d376e17072c1b60c3fee66f3be58ef018952d.

Commit 8990cac6e5ea ("x86/jump_label: Initialize static branching
early") adds jump_label_init() call in setup_arch() to make static
keys initialized early, so we could use the original simpler code
again.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Juergen Gross <jgross@suse.com>
arch/x86/kernel/smpboot.c
arch/x86/xen/spinlock.c

index 259d1d2be076fc3b7fe43e6ee1a2e6086709447b..fdbd47ceb84d45cc9db743633e42f29e18913d59 100644 (file)
@@ -1368,8 +1368,6 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
        pr_info("CPU0: ");
        print_cpu_info(&cpu_data(0));
 
-       native_pv_lock_init();
-
        uv_system_init();
 
        set_mtrr_aps_delayed_init();
@@ -1399,6 +1397,7 @@ void __init native_smp_prepare_boot_cpu(void)
        /* already set me in cpu_online_mask in boot_cpu_init() */
        cpumask_set_cpu(me, cpu_callout_mask);
        cpu_set_state_online(me);
+       native_pv_lock_init();
 }
 
 void __init calculate_max_logical_packages(void)
index 3776122c87cce16efb8da63de8c32c78696e52d1..6deb49094c605815ce35a9f71a3589f687017b6f 100644 (file)
@@ -68,11 +68,8 @@ void xen_init_lock_cpu(int cpu)
        int irq;
        char *name;
 
-       if (!xen_pvspin) {
-               if (cpu == 0)
-                       static_branch_disable(&virt_spin_lock_key);
+       if (!xen_pvspin)
                return;
-       }
 
        WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on IRQ%d!\n",
             cpu, per_cpu(lock_kicker_irq, cpu));
@@ -124,6 +121,7 @@ void __init xen_init_spinlocks(void)
 
        if (!xen_pvspin) {
                printk(KERN_DEBUG "xen: PV spinlocks disabled\n");
+               static_branch_disable(&virt_spin_lock_key);
                return;
        }
        printk(KERN_DEBUG "xen: PV spinlocks enabled\n");