From: "Jan Beulich" Subject: [PATCH] linux-2.6.18/evtchn: clear secondary CPUs' cpu_evtchn_mask[] after restore Date: Mon, 15 Nov 2010 16:56:48 +0000 Message-ID: <4CE1746002000078000224AA@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartE3CE4340.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartE3CE4340.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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. 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)); =20 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]))= ; } =20 static inline unsigned int cpu_from_evtchn(unsigned int evtchn) --=__PartE3CE4340.0__= Content-Type: text/plain; name="xen-evtchn-cpu-clear.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xen-evtchn-cpu-clear.patch" To bind all event channels to CPU#0, it is not sufficient to set all = of=0Aits cpu_evtchn_mask[] bits; all other CPUs also need to get their = bits=0Acleared. Otherwise, evtchn_do_upcall() will start handling = interrupts=0Aon CPUs they're not intended to run on, which can be = particularly bad=0Afor per-CPU ones.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/drivers/xen/core/evtchn.c=0A+++ b/drivers/= xen/core/evtchn.c=0A@@ -161,7 +161,8 @@ static void init_evtchn_cpu_binding= s(voi=0A set_native_irq_info(i, cpumask_of_cpu(0));=0A =0A = memset(cpu_evtchn, 0, sizeof(cpu_evtchn));=0A- memset(cpu_evtchn_mask[0], = ~0, sizeof(cpu_evtchn_mask[0]));=0A+ for_each_possible_cpu(i)=0A+ = memset(cpu_evtchn_mask[i], -!i, sizeof(cpu_evtchn_mask[i]));=0A }=0A =0A = static inline unsigned int cpu_from_evtchn(unsigned int evtchn)=0A --=__PartE3CE4340.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__PartE3CE4340.0__=--