From: tip-bot for Thomas Gleixner <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
konrad.wilk@oracle.com, peterz@infradead.org,
xen-devel@lists.xenproject.org, tglx@linutronix.de,
david.vrabel@citrix.com
Subject: [tip:irq/core] xen: Validate online cpus in set_affinity
Date: Wed, 12 Mar 2014 05:15:48 -0700 [thread overview]
Message-ID: <tip-753fbd23f5e59ea9dc0cabe0a684d32100a4af02@git.kernel.org> (raw)
In-Reply-To: <20140304203100.978031089@linutronix.de>
Commit-ID: 753fbd23f5e59ea9dc0cabe0a684d32100a4af02
Gitweb: http://git.kernel.org/tip/753fbd23f5e59ea9dc0cabe0a684d32100a4af02
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 4 Mar 2014 20:43:40 +0000
Committer: Thomas Gleixner <tglx@linutronix.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@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>
---
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);
}
next prev parent reply other threads:[~2014-03-12 12:16 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-04 20:43 [patch 0/5] genirq: Sanitize irq_set_affinity callbacks Thomas Gleixner
2014-03-04 20:43 ` [patch 1/5] ia64: Validate online cpus in irq_set_affinity() callbacks Thomas Gleixner
2014-03-04 20:43 ` Thomas Gleixner
2014-03-12 12:15 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-12 12:15 ` tip-bot for Thomas Gleixner
2014-03-04 20:43 ` [patch 2/5] mips: " Thomas Gleixner
2014-03-05 11:20 ` Peter Zijlstra
2014-03-05 14:54 ` Thomas Gleixner
2014-03-12 12:15 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 20:43 ` [patch 4/5] xen: Validate online cpus in set_affinity Thomas Gleixner
2014-03-04 20:43 ` Thomas Gleixner
2014-03-05 10:36 ` David Vrabel
2014-03-05 10:36 ` David Vrabel
2014-03-12 12:15 ` tip-bot for Thomas Gleixner [this message]
2014-03-12 12:15 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 20:43 ` [patch 3/5] parisc: Validate online cpus in irq_set_affinity() callbacks Thomas Gleixner
2014-03-12 12:16 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-03-04 20:43 ` [patch 5/5] irqchip: armanda: Sanitize set_irq_affinity() Thomas Gleixner
2014-03-06 19:05 ` Jason Cooper
2014-03-07 16:02 ` Gregory CLEMENT
2014-03-07 17:17 ` Thomas Gleixner
2014-03-18 14:06 ` Gregory CLEMENT
2014-03-18 20:55 ` Thomas Gleixner
2014-03-18 21:04 ` Gregory CLEMENT
2014-04-24 16:04 ` Gregory CLEMENT
2014-04-25 11:15 ` Jason Cooper
2014-04-28 19:05 ` Thomas Gleixner
2014-04-28 19:33 ` [tip:irq/urgent] " tip-bot for Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-753fbd23f5e59ea9dc0cabe0a684d32100a4af02@git.kernel.org \
--to=tipbot@zytor.com \
--cc=david.vrabel@citrix.com \
--cc=hpa@zytor.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.