Skip to contentSkip to conversation

xen: minor fix in apic ipi interface func

PATCH In review Zhenzhong Duan 2 participants 3 messages Apr 9, 2013 – Apr 10, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: minor fix in apic ipi interface func

xen_send_IPI_mask_allbutself uses native vector as input other than xen_vector.

xen_send_IPI_one need to be called to pass xen_vector in xen_send_IPI_mask_allbutself.

---
 arch/x86/xen/smp.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
arch/x86/xen/smp.c +6 -5
index 09ea61d..bf27868 100644
@@ -565,6 +565,10 @@ void xen_send_IPI_mask_allbutself(const struct cpumask *mask,
 {
 	unsigned cpu;
 	unsigned int this_cpu = smp_processor_id();
+	int xen_vector = xen_map_vector(vector);
+
+	if (xen_vector < 0)
+		return;
 
 	if (!(num_online_cpus() > 1))
 		return;
@@ -573,16 +577,13 @@ void xen_send_IPI_mask_allbutself(const struct cpumask *mask,
 		if (this_cpu == cpu)
 			continue;
 
-		xen_smp_send_call_function_single_ipi(cpu);
+		xen_send_IPI_one(cpu, xen_vector);
 	}
 }
 
 void xen_send_IPI_allbutself(int vector)
 {
-	int xen_vector = xen_map_vector(vector);
-
-	if (xen_vector >= 0)
-		xen_send_IPI_mask_allbutself(cpu_online_mask, xen_vector);
+	xen_send_IPI_mask_allbutself(cpu_online_mask, vector);
 }
 
 static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id)
Signature · 1 line
1.7.3
#1 lore raw
Quoted 1 line · Zhenzhong Duan

xen_send_IPI_mask_allbutself uses native vector as input other than xen_vector.

Ouch. But it looks as the only user of the .send_IPI_mask_allbutself is just xen_send_IPI_allbutself? Or is there another user of this?

Is there a particular bug that was found with this?

Quoted 2 lines

xen_send_IPI_one need to be called to pass xen_vector in xen_send_IPI_mask_allbutself.

Right, as we are using now 'xen_vector'.

Quoted 43 lines
---
 arch/x86/xen/smp.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
arch/x86/xen/smp.c +6 -5
index 09ea61d..bf27868 100644
@@ -565,6 +565,10 @@ void xen_send_IPI_mask_allbutself(const struct cpumask *mask,
 {
 	unsigned cpu;
 	unsigned int this_cpu = smp_processor_id();
+	int xen_vector = xen_map_vector(vector);
+
+	if (xen_vector < 0)
+		return;
 
 	if (!(num_online_cpus() > 1))
 		return;
@@ -573,16 +577,13 @@ void xen_send_IPI_mask_allbutself(const struct cpumask *mask,
 		if (this_cpu == cpu)
 			continue;
 
-		xen_smp_send_call_function_single_ipi(cpu);
+		xen_send_IPI_one(cpu, xen_vector);
 	}
 }
 
 void xen_send_IPI_allbutself(int vector)
 {
-	int xen_vector = xen_map_vector(vector);
-
-	if (xen_vector >= 0)
-		xen_send_IPI_mask_allbutself(cpu_online_mask, xen_vector);
+	xen_send_IPI_mask_allbutself(cpu_online_mask, vector);
 }
 
 static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id)
Signature · 1 line
1.7.3
#2 lore raw
Quoted 4 lines · Konrad Rzeszutek Wilk
Quoted 1 line · Zhenzhong Duan

xen_send_IPI_mask_allbutself uses native vector as input other than xen_vector.

Ouch. But it looks as the only user of the .send_IPI_mask_allbutself is just xen_send_IPI_allbutself? Or is there another user of this?

It looks __default_local_send_IPI_allbutself called apic->send_IPI_mask_allbutself.

In set_xen_basic_apic_ops, apic->send_IPI_mask_allbutself = xen_send_IPI_mask_allbutself. apic->send_IPI_mask_allbutself use native vector as input like other funcs.

Quoted 1 line

Is there a particular bug that was found with this?

No, just looking at code and see the error.

zduan