]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
genirq: Revert sparse irq locking around __cpu_up() and move it to x86 for now
authorThomas Gleixner <tglx@linutronix.de>
Tue, 14 Jul 2015 20:03:57 +0000 (22:03 +0200)
committerEthan Zhao <ethan.zhao@oracle.com>
Thu, 7 Sep 2017 23:09:10 +0000 (07:09 +0800)
Boris reported that the sparse_irq protection around __cpu_up() in the
generic code causes a regression on Xen. Xen allocates interrupts and
some more in the xen_cpu_up() function, so it deadlocks on the
sparse_irq_lock.

There is no simple fix for this and we really should have the
protection for all architectures, but for now the only solution is to
move it to x86 where actual wreckage due to the lack of protection has
been observed.

Reported-and-tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Fixes: a89941816726 'hotplug: Prevent alloc/free of irq descriptors during cpu up/down'
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: xiao jin <jin.xiao@intel.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Yanmin Zhang <yanmin_zhang@linux.intel.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
(cherry picked from commit ce0d3c0a6fb1422101498ef378c0851dabbbf67f)

Orabug: 25671838

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Reviewed-by: Brian Maly <brian.maly@oracle.com>
arch/x86/kernel/smpboot.c
kernel/cpu.c

index ead6f89179dc7d0a92ad6cbf5e33bcfc8cef9f28..1f18778d3d7635d38e4dcb9f9691141347b04ccd 100644 (file)
@@ -958,8 +958,17 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
 
        common_cpu_up(cpu, tidle);
 
+       /*
+        * We have to walk the irq descriptors to setup the vector
+        * space for the cpu which comes online.  Prevent irq
+        * alloc/free across the bringup.
+        */
+       irq_lock_sparse();
+
        err = do_boot_cpu(apicid, cpu, tidle);
+
        if (err) {
+               irq_unlock_sparse();
                pr_err("do_boot_cpu failed(%d) to wakeup CPU#%u\n", err, cpu);
                return -EIO;
        }
@@ -977,6 +986,8 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
                touch_nmi_watchdog();
        }
 
+       irq_unlock_sparse();
+
        return 0;
 }
 
index ca84a49016a1d23b1124c39bfaae87a791c3d834..f40ed44bb4125850a43622b03dde18888841afec 100644 (file)
@@ -528,18 +528,9 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen)
                goto out_notify;
        }
 
-       /*
-        * Some architectures have to walk the irq descriptors to
-        * setup the vector space for the cpu which comes online.
-        * Prevent irq alloc/free across the bringup.
-        */
-       irq_lock_sparse();
-
        /* Arch-specific enabling code. */
        ret = __cpu_up(cpu, idle);
 
-       irq_unlock_sparse();
-
        if (ret != 0)
                goto out_notify;
        BUG_ON(!cpu_online(cpu));