hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/x86/xen/smp.c
....@@ -32,30 +32,30 @@
3232
3333 void xen_smp_intr_free(unsigned int cpu)
3434 {
35
+ kfree(per_cpu(xen_resched_irq, cpu).name);
36
+ per_cpu(xen_resched_irq, cpu).name = NULL;
3537 if (per_cpu(xen_resched_irq, cpu).irq >= 0) {
3638 unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu).irq, NULL);
3739 per_cpu(xen_resched_irq, cpu).irq = -1;
38
- kfree(per_cpu(xen_resched_irq, cpu).name);
39
- per_cpu(xen_resched_irq, cpu).name = NULL;
4040 }
41
+ kfree(per_cpu(xen_callfunc_irq, cpu).name);
42
+ per_cpu(xen_callfunc_irq, cpu).name = NULL;
4143 if (per_cpu(xen_callfunc_irq, cpu).irq >= 0) {
4244 unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu).irq, NULL);
4345 per_cpu(xen_callfunc_irq, cpu).irq = -1;
44
- kfree(per_cpu(xen_callfunc_irq, cpu).name);
45
- per_cpu(xen_callfunc_irq, cpu).name = NULL;
4646 }
47
+ kfree(per_cpu(xen_debug_irq, cpu).name);
48
+ per_cpu(xen_debug_irq, cpu).name = NULL;
4749 if (per_cpu(xen_debug_irq, cpu).irq >= 0) {
4850 unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu).irq, NULL);
4951 per_cpu(xen_debug_irq, cpu).irq = -1;
50
- kfree(per_cpu(xen_debug_irq, cpu).name);
51
- per_cpu(xen_debug_irq, cpu).name = NULL;
5252 }
53
+ kfree(per_cpu(xen_callfuncsingle_irq, cpu).name);
54
+ per_cpu(xen_callfuncsingle_irq, cpu).name = NULL;
5355 if (per_cpu(xen_callfuncsingle_irq, cpu).irq >= 0) {
5456 unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu).irq,
5557 NULL);
5658 per_cpu(xen_callfuncsingle_irq, cpu).irq = -1;
57
- kfree(per_cpu(xen_callfuncsingle_irq, cpu).name);
58
- per_cpu(xen_callfuncsingle_irq, cpu).name = NULL;
5959 }
6060 }
6161
....@@ -65,6 +65,7 @@
6565 char *resched_name, *callfunc_name, *debug_name;
6666
6767 resched_name = kasprintf(GFP_KERNEL, "resched%d", cpu);
68
+ per_cpu(xen_resched_irq, cpu).name = resched_name;
6869 rc = bind_ipi_to_irqhandler(XEN_RESCHEDULE_VECTOR,
6970 cpu,
7071 xen_reschedule_interrupt,
....@@ -74,9 +75,9 @@
7475 if (rc < 0)
7576 goto fail;
7677 per_cpu(xen_resched_irq, cpu).irq = rc;
77
- per_cpu(xen_resched_irq, cpu).name = resched_name;
7878
7979 callfunc_name = kasprintf(GFP_KERNEL, "callfunc%d", cpu);
80
+ per_cpu(xen_callfunc_irq, cpu).name = callfunc_name;
8081 rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_VECTOR,
8182 cpu,
8283 xen_call_function_interrupt,
....@@ -86,18 +87,21 @@
8687 if (rc < 0)
8788 goto fail;
8889 per_cpu(xen_callfunc_irq, cpu).irq = rc;
89
- per_cpu(xen_callfunc_irq, cpu).name = callfunc_name;
9090
91
- debug_name = kasprintf(GFP_KERNEL, "debug%d", cpu);
92
- rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu, xen_debug_interrupt,
93
- IRQF_PERCPU | IRQF_NOBALANCING,
94
- debug_name, NULL);
95
- if (rc < 0)
96
- goto fail;
97
- per_cpu(xen_debug_irq, cpu).irq = rc;
98
- per_cpu(xen_debug_irq, cpu).name = debug_name;
91
+ if (!xen_fifo_events) {
92
+ debug_name = kasprintf(GFP_KERNEL, "debug%d", cpu);
93
+ per_cpu(xen_debug_irq, cpu).name = debug_name;
94
+ rc = bind_virq_to_irqhandler(VIRQ_DEBUG, cpu,
95
+ xen_debug_interrupt,
96
+ IRQF_PERCPU | IRQF_NOBALANCING,
97
+ debug_name, NULL);
98
+ if (rc < 0)
99
+ goto fail;
100
+ per_cpu(xen_debug_irq, cpu).irq = rc;
101
+ }
99102
100103 callfunc_name = kasprintf(GFP_KERNEL, "callfuncsingle%d", cpu);
104
+ per_cpu(xen_callfuncsingle_irq, cpu).name = callfunc_name;
101105 rc = bind_ipi_to_irqhandler(XEN_CALL_FUNCTION_SINGLE_VECTOR,
102106 cpu,
103107 xen_call_function_single_interrupt,
....@@ -107,7 +111,6 @@
107111 if (rc < 0)
108112 goto fail;
109113 per_cpu(xen_callfuncsingle_irq, cpu).irq = rc;
110
- per_cpu(xen_callfuncsingle_irq, cpu).name = callfunc_name;
111114
112115 return 0;
113116
....@@ -132,7 +135,7 @@
132135 if (xen_vcpu_nr(cpu) < MAX_VIRT_CPUS)
133136 continue;
134137
135
- rc = cpu_down(cpu);
138
+ rc = remove_cpu(cpu);
136139
137140 if (rc == 0) {
138141 /*