aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-03-04 15:43:40 -0500
committerThomas Gleixner <tglx@linutronix.de>2014-03-12 08:07:41 -0400
commit753fbd23f5e59ea9dc0cabe0a684d32100a4af02 (patch)
tree2f82e7b6c8f73369d90476659545493f0d115ed5 /drivers/xen
parent421d1563c6620423d23e394711e3f209e585c161 (diff)
xen: Validate online cpus in set_affinity
The user space interface does not filter out offline cpus. It merily verifies that the mask contains at least one online cpu. So the selector in the irq chip implementation needs to make sure to pick only an online cpu because otherwise: Offline Core 1 Set affinity to 0xe Selector will pick first set bit, i.e. core 1 Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: David Vrabel <david.vrabel@citrix.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Xen <xen-devel@lists.xenproject.org> Link: http://lkml.kernel.org/r/20140304203100.978031089@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/events/events_base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 8b91c2561b68..c3458f58de90 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -1324,7 +1324,7 @@ static int rebind_irq_to_cpu(unsigned irq, unsigned tcpu)
1324static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest, 1324static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest,
1325 bool force) 1325 bool force)
1326{ 1326{
1327 unsigned tcpu = cpumask_first(dest); 1327 unsigned tcpu = cpumask_first_and(dest, cpu_online_mask);
1328 1328
1329 return rebind_irq_to_cpu(data->irq, tcpu); 1329 return rebind_irq_to_cpu(data->irq, tcpu);
1330} 1330}