[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-753fbd23f5e59ea9dc0cabe0a684d32100a4af02@git.kernel.org>
Date: Wed, 12 Mar 2014 05:15:48 -0700
From: tip-bot for Thomas Gleixner <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
konrad.wilk@...cle.com, peterz@...radead.org,
xen-devel@...ts.xenproject.org, tglx@...utronix.de,
david.vrabel@...rix.com
Subject: [tip:irq/core] xen: Validate online cpus in set_affinity
Commit-ID: 753fbd23f5e59ea9dc0cabe0a684d32100a4af02
Gitweb: http://git.kernel.org/tip/753fbd23f5e59ea9dc0cabe0a684d32100a4af02
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Tue, 4 Mar 2014 20:43:40 +0000
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 12 Mar 2014 13:07:41 +0100
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@...utronix.de>
Reviewed-by: David Vrabel <david.vrabel@...rix.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc: Xen <xen-devel@...ts.xenproject.org>
Link: http://lkml.kernel.org/r/20140304203100.978031089@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
drivers/xen/events/events_base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 8b91c256..c3458f5 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)
static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest,
bool force)
{
- unsigned tcpu = cpumask_first(dest);
+ unsigned tcpu = cpumask_first_and(dest, cpu_online_mask);
return rebind_irq_to_cpu(data->irq, tcpu);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists