WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] IRQ fix incorrect logic in __clear_irq_vector (v

To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] IRQ fix incorrect logic in __clear_irq_vector (v2)
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Fri, 12 Aug 2011 16:21:06 +0100
Cc:
Delivery-date: Fri, 12 Aug 2011 08:21:51 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=1r0YVwnAS0009KYc/bSBca2HXE5k4QcWD49Vpu/5bsM=; b=m7537oh40sPu0Ii3O8Ki6P9y11YgZJK3Zm65+tzACKXzfDlMV6RzsLcIDj8SwwqCI0 n0BFEqMzP1CF0cKNu0r/d40ONyl8kG7Q0wwXnShGqoYGSsVD+HfeFcn8MhBevVPJ58tQ HXRSKKESx7IZnflOFxT86r+0wZfRRMXjC4tc4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <bd106cc2aa6553606794.1313157258@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcxZA3RtcyHET3fI4ECBx+MFtcjtyQ==
Thread-topic: [Xen-devel] [PATCH] IRQ fix incorrect logic in __clear_irq_vector (v2)
User-agent: Microsoft-Entourage/12.30.0.110427
On 12/08/2011 14:54, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx> wrote:

> In the old code, tmp_mask is the cpu_and of cfg->cpu_mask and
> cpu_online_map.  However, in the usual case of moving an IRQ from one
> PCPU to another because the scheduler decides its a good idea,
> cfg->cpu_mask and cfg->old_cpu_mask do not intersect.  This causes the
> old cpu vector_irq table to keep the irq reference when it shouldn't.
> 
> This leads to a resource leak if a domain is shut down wile an irq has
> a move pending, which results in Xen's create_irq() eventually failing
> with -ENOSPC when all vector_irq tables are full of stale references.
> 
> v2: reuse tmp_mask to take account of online cpus

Nasty bug, nice fix!

The extra field in irq_cfg sounds plausible to me -- I don't mind adding it
if it's a nice cleanup.

 Thanks,
 Keir

> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> 
> diff -r 1f08b380d438 -r bd106cc2aa65 xen/arch/x86/irq.c
> --- a/xen/arch/x86/irq.c Wed Aug 10 14:43:34 2011 +0100
> +++ b/xen/arch/x86/irq.c Fri Aug 12 14:54:11 2011 +0100
> @@ -216,6 +216,7 @@ static void __clear_irq_vector(int irq)
>  
>      if (likely(!cfg->move_in_progress))
>          return;
> +    cpus_and(tmp_mask, cfg->old_cpu_mask, cpu_online_map);
>      for_each_cpu_mask(cpu, tmp_mask) {
>          for (vector = FIRST_DYNAMIC_VECTOR; vector <= LAST_DYNAMIC_VECTOR;
>                                  vector++) {
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel