hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/x86/xen/spinlock.c
....@@ -75,6 +75,7 @@
7575 cpu, per_cpu(lock_kicker_irq, cpu));
7676
7777 name = kasprintf(GFP_KERNEL, "spinlock%d", cpu);
78
+ per_cpu(irq_name, cpu) = name;
7879 irq = bind_ipi_to_irqhandler(XEN_SPIN_UNLOCK_VECTOR,
7980 cpu,
8081 dummy_handler,
....@@ -85,7 +86,6 @@
8586 if (irq >= 0) {
8687 disable_irq(irq); /* make sure it's never delivered */
8788 per_cpu(lock_kicker_irq, cpu) = irq;
88
- per_cpu(irq_name, cpu) = name;
8989 }
9090
9191 printk("cpu %d spinlock event irq %d\n", cpu, irq);
....@@ -98,6 +98,8 @@
9898 if (!xen_pvspin)
9999 return;
100100
101
+ kfree(per_cpu(irq_name, cpu));
102
+ per_cpu(irq_name, cpu) = NULL;
101103 /*
102104 * When booting the kernel with 'mitigations=auto,nosmt', the secondary
103105 * CPUs are not activated, and lock_kicker_irq is not initialized.
....@@ -108,8 +110,6 @@
108110
109111 unbind_from_irqhandler(irq, NULL);
110112 per_cpu(lock_kicker_irq, cpu) = -1;
111
- kfree(per_cpu(irq_name, cpu));
112
- per_cpu(irq_name, cpu) = NULL;
113113 }
114114
115115 PV_CALLEE_SAVE_REGS_THUNK(xen_vcpu_stolen);