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] linux-2.6.18/evtchn: clear secondary CPUs' cpu_e

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] linux-2.6.18/evtchn: clear secondary CPUs' cpu_evtchn_mask[] after restore
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Mon, 15 Nov 2010 17:28:03 -0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 15 Nov 2010 17:29:09 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4CE1746002000078000224AA@xxxxxxxxxxxxxxxxxx>
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>
References: <4CE1746002000078000224AA@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.1.6-1.fc13 Lightning/1.0b3pre Thunderbird/3.1.6
On 11/15/2010 08:56 AM, Jan Beulich wrote:
> To bind all event channels to CPU#0, it is not sufficient to set all of
> its cpu_evtchn_mask[] bits; all other CPUs also need to get their bits
> cleared. Otherwise, evtchn_do_upcall() will start handling interrupts
> on CPUs they're not intended to run on, which can be particularly bad
> for per-CPU ones.

Yes, that would be awkward.

> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
>
> --- a/drivers/xen/core/evtchn.c
> +++ b/drivers/xen/core/evtchn.c
> @@ -161,7 +161,8 @@ static void init_evtchn_cpu_bindings(voi
>               set_native_irq_info(i, cpumask_of_cpu(0));
>  
>       memset(cpu_evtchn, 0, sizeof(cpu_evtchn));
> -     memset(cpu_evtchn_mask[0], ~0, sizeof(cpu_evtchn_mask[0]));
> +     for_each_possible_cpu(i)
> +             memset(cpu_evtchn_mask[i], -!i, sizeof(cpu_evtchn_mask[i]));

-!i?  Really?  Golf-clap and all, but I think something a bit more
explicit would be better ;)

    J

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