linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen: minor fix in apic ipi interface func
@ 2013-04-09 10:51 Zhenzhong Duan
  2013-04-09 19:20 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 3+ messages in thread
From: Zhenzhong Duan @ 2013-04-09 10:51 UTC (permalink / raw)
  To: xen-devel, linux-kernel; +Cc: Konrad Rzeszutek Wilk, Feng Jin, ben

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.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
---
 arch/x86/xen/smp.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 09ea61d..bf27868 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -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)
-- 
1.7.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen: minor fix in apic ipi interface func
  2013-04-09 10:51 [PATCH] xen: minor fix in apic ipi interface func Zhenzhong Duan
@ 2013-04-09 19:20 ` Konrad Rzeszutek Wilk
  2013-04-10  2:25   ` Zhenzhong Duan
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-04-09 19:20 UTC (permalink / raw)
  To: Zhenzhong Duan; +Cc: xen-devel, linux-kernel, Feng Jin, ben

On Tue, Apr 09, 2013 at 06:51:09PM +0800, Zhenzhong Duan wrote:
> 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?
> 
> 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'.

> 
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
> ---
>  arch/x86/xen/smp.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
> index 09ea61d..bf27868 100644
> --- a/arch/x86/xen/smp.c
> +++ b/arch/x86/xen/smp.c
> @@ -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)
> -- 
> 1.7.3
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen: minor fix in apic ipi interface func
  2013-04-09 19:20 ` Konrad Rzeszutek Wilk
@ 2013-04-10  2:25   ` Zhenzhong Duan
  0 siblings, 0 replies; 3+ messages in thread
From: Zhenzhong Duan @ 2013-04-10  2:25 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: xen-devel, linux-kernel, Feng Jin, ben


On 2013-04-10 03:20, Konrad Rzeszutek Wilk wrote:
> On Tue, Apr 09, 2013 at 06:51:09PM +0800, Zhenzhong Duan wrote:
>> 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.

> Is there a particular bug that was found with this?
No, just looking at code and see the error.

zduan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-10  2:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-09 10:51 [PATCH] xen: minor fix in apic ipi interface func Zhenzhong Duan
2013-04-09 19:20 ` Konrad Rzeszutek Wilk
2013-04-10  2:25   ` Zhenzhong Duan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).