public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genirq: Dont allow affinity mask to be updated on IPIs
@ 2016-04-21  9:08 Matt Redfearn
  2016-04-21 10:09 ` [tip:irq/urgent] " tip-bot for Matt Redfearn
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Redfearn @ 2016-04-21  9:08 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: lisa.parratt, jason, ralf, linux-kernel, jiang.liu, marc.zyngier,
	linux-mips, Qais Yousef, Matt Redfearn

The IPI domain re-purposes the IRQ affinity to signify the mask of CPUs
that this IPI will deliver to. This must not be modified before the IPI
is destroyed again, so set the IRQ_NO_BALANCING flag to prevent the
affinity being overwritten by setup_affinity().

Without this, if an IPI is reserved for a single target CPU, then
allocated using __setup_irq(), the affinity is overwritten with
cpu_online_mask. When ipi_destroy() is subsequently called on a
multi-cpu system, it will attempt to free cpumask_weight() IRQs
that were never allocated, and crash.

Fixes: d17bf24e6952 ("genirq: Add a new generic IPI reservation code to
irq core")
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
---

 kernel/irq/ipi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/ipi.c b/kernel/irq/ipi.c
index c37f34b00a11..14777af8e097 100644
--- a/kernel/irq/ipi.c
+++ b/kernel/irq/ipi.c
@@ -94,6 +94,7 @@ unsigned int irq_reserve_ipi(struct irq_domain *domain,
 		data = irq_get_irq_data(virq + i);
 		cpumask_copy(data->common->affinity, dest);
 		data->common->ipi_offset = offset;
+		irq_set_status_flags(virq + i, IRQ_NO_BALANCING);
 	}
 	return virq;
 
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-21 10:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-21  9:08 [PATCH] genirq: Dont allow affinity mask to be updated on IPIs Matt Redfearn
2016-04-21 10:09 ` [tip:irq/urgent] " tip-bot for Matt Redfearn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox