Skip to content

Commit

Permalink
xen/evtchn: clear secondary CPUs' cpu_evtchn_mask[] after restore
Browse files Browse the repository at this point in the history
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.

[ linux-2.6.18-xen.hg 7de7453dee36 ]

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
  • Loading branch information
Jan Beulich authored and Jeremy Fitzhardinge committed Nov 16, 2010
1 parent 7e77506 commit 1c6969e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,20 @@ static void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu)

static void init_evtchn_cpu_bindings(void)
{
int i;
#ifdef CONFIG_SMP
struct irq_desc *desc;
int i;

/* By default all event channels notify CPU#0. */
for_each_irq_desc(i, desc) {
cpumask_copy(desc->affinity, cpumask_of(0));
}
#endif

memset(cpu_evtchn_mask(0), ~0, sizeof(struct cpu_evtchn_s));
for_each_possible_cpu(i)
memset(cpu_evtchn_mask(i),
(i == 0) ? ~0 : 0, sizeof(struct cpu_evtchn_s));

}

static inline void clear_evtchn(int port)
Expand Down

0 comments on commit 1c6969e

Please sign in to comment.