On Thu, Mar 17, 2016 at 09:33:32AM -0400, Boris Ostrovsky wrote:
Commit ce0d3c0a6fb1 ("genirq: Revert sparse irq locking aroundOriginal being "hotplug: Prevent alloc/free..." ?
__cpu_up() and move it to x86 for now") reverted irq locking
introduced by commit a89941816726 ("hotplug: Prevent alloc/free
of irq descriptors during cpu up/down") because of Xen allocating
irqs in both of its cpu_up ops.
We can move those allocations into CPU notifiers so that original
patch can be reinstated.
-static int xen_hvm_cpu_notify(struct notifier_block *self, unsigned long action,
- void *hcpu)
+static int xen_cpu_notify(struct notifier_block *self, unsigned long action,
+ void *hcpu)
{
int cpu = (long)hcpu;
+ int rc;
+
switch (action) {
case CPU_UP_PREPARE:
- xen_vcpu_setup(cpu);
- if (xen_have_vector_callback) {
- if (xen_feature(XENFEAT_hvm_safe_pvclock))
- xen_setup_timer(cpu);
+ if (xen_hvm_domain()) {
+ /*
+ * This can happen if CPU was offlined earlier and
+ * offlining timed out in common_cpu_die().
+ */
+ if (cpu_report_state(cpu) == CPU_DEAD_FROZEN) {
+ xen_smp_intr_free(cpu);
+ xen_uninit_lock_cpu(cpu);
+ }
+
+ xen_vcpu_setup(cpu);
}
+
+ if (xen_pv_domain() ||
+ (xen_have_vector_callback &&
+ xen_feature(XENFEAT_hvm_safe_pvclock)))
+ xen_setup_timer(cpu);
+
+ rc = xen_smp_intr_init(cpu);
+ if (rc) {
+ WARN(1, "xen_smp_intr_init() for CPU %d failed: %d\n",
+ cpu, rc);
+ return NOTIFY_BAD;
+ }
+
+ break;
+ case CPU_ONLINE:
+ xen_init_lock_cpu(cpu);
+ break;
+ case CPU_UP_CANCELED:
+ xen_smp_intr_free(cpu);
xen_uninit_lock_cpu ?
+ if (xen_pv_domain() ||
+ (xen_have_vector_callback &&
+ xen_feature(XENFEAT_hvm_safe_pvclock)))
+ xen_teardown_timer(cpu);
break;
default:
break;