From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH] linux-2.6.18/evtchn: clear secondary CPUs' cpu_evtchn_mask[] after restore Date: Mon, 15 Nov 2010 17:28:03 -0800 Message-ID: <4CE1DE23.9070002@goop.org> References: <4CE1746002000078000224AA@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4CE1746002000078000224AA@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org 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 > > --- 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