linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 00/15] arm/arm64: fix use of irq_find_mapping outside of legal RCU context
Date: Tue,  8 Jul 2014 14:10:23 +0100	[thread overview]
Message-ID: <1404825038-547-1-git-send-email-marc.zyngier@arm.com> (raw)

A number of irqchip drivers are directly calling irq_find_mapping,
which may use a rcu_read_lock call when walking the radix tree.

Turns out that if you hit that point with CONFIG_PROVE_RCU enabled,
the kernel will shout at you, as using RCU in this context may be
illegal (specially if coming from the idle state, where RCU would be
in a quiescent state).

A possible fix would be to wrap calls to irq_find_mapping into a
RCU_NONIDLE macro, but that really looks ugly.

This patch series introduce another IRQ entry point on arm and arm64
(handle_domain_irq), which has the exact same behaviour as handle_IRQ,
except that it also takes a irq_domain pointer. This allows the
logical IRQ lookup to be done inside the irq_{enter,exit} section,
which contains a rcu_irq_{enter,exit}, making it safe.

A number of irqchips are then converted to this new entry point. I've
converted all the direct users of irq_find_mapping, except for the
cases where it was used as a chained handler (chained_irq_{enter,exit}
makes it safe). Users of irq_linear_revmap are safe as well.

I've given it some light testing on arm64. The series is also
available in my tree:

git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git handle_domain_irq

Marc Zyngier (15):
  arm64: pass IRQ domain to the core IRQ handler
  ARM: pass IRQ domain to the core IRQ handler
  irqchip: GIC: convert to handle_domain_irq
  irqchip: armada-370-xp: convert to handle_domain_irq
  irqchip: clps711x: convert to handle_domain_irq
  irqchip: mmp: convert to handle_domain_irq
  irqchip: mxs: convert to handle_domain_irq
  irqchip: orion: convert to handle_domain_irq
  irqchip: s3c24xx: convert to handle_domain_irq
  irqchip: sirfsoc: convert to handle_domain_irq
  irqchip: sun4i: convert to handle_domain_irq
  irqchip: versatile-fpga: convert to handle_domain_irq
  irqchip: vic: convert to handle_domain_irq
  irqchip: vt8500: convert to handle_domain_irq
  irqchip: zevio: convert to handle_domain_irq

 arch/arm/include/asm/irq.h           |  2 ++
 arch/arm/kernel/irq.c                | 23 +++++++++++++++++++----
 arch/arm64/include/asm/hardirq.h     |  4 ++++
 arch/arm64/kernel/irq.c              | 23 ++++++++++++++++++++---
 drivers/irqchip/irq-armada-370-xp.c  | 19 ++++++++++---------
 drivers/irqchip/irq-clps711x.c       | 18 +++++++-----------
 drivers/irqchip/irq-gic.c            |  3 +--
 drivers/irqchip/irq-mmp.c            | 10 ++++------
 drivers/irqchip/irq-mxs.c            |  3 +--
 drivers/irqchip/irq-orion.c          |  5 ++---
 drivers/irqchip/irq-s3c24xx.c        |  4 +---
 drivers/irqchip/irq-sirfsoc.c        |  6 ++----
 drivers/irqchip/irq-sun4i.c          |  5 ++---
 drivers/irqchip/irq-versatile-fpga.c |  2 +-
 drivers/irqchip/irq-vic.c            |  2 +-
 drivers/irqchip/irq-vt8500.c         |  5 ++---
 drivers/irqchip/irq-zevio.c          |  3 +--
 17 files changed, 80 insertions(+), 57 deletions(-)

-- 
2.0.0

             reply	other threads:[~2014-07-08 13:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 13:10 Marc Zyngier [this message]
2014-07-08 13:10 ` [PATCH 01/15] arm64: pass IRQ domain to the core IRQ handler Marc Zyngier
2014-07-08 13:10 ` [PATCH 02/15] ARM: " Marc Zyngier
2014-08-02  7:51   ` Russell King - ARM Linux
2014-08-04 10:00     ` Marc Zyngier
2014-07-08 13:10 ` [PATCH 03/15] irqchip: GIC: convert to handle_domain_irq Marc Zyngier
2014-07-08 13:10 ` [PATCH 04/15] irqchip: armada-370-xp: " Marc Zyngier
2014-07-08 13:10 ` [PATCH 05/15] irqchip: clps711x: " Marc Zyngier
2014-07-08 13:10 ` [PATCH 06/15] irqchip: mmp: " Marc Zyngier
2014-07-08 13:10 ` [PATCH 07/15] irqchip: mxs: " Marc Zyngier
2014-07-08 13:10 ` [PATCH 08/15] irqchip: orion: " Marc Zyngier
2014-07-08 13:10 ` [PATCH 09/15] irqchip: s3c24xx: " Marc Zyngier
2014-07-08 13:10 ` [PATCH 10/15] irqchip: sirfsoc: " Marc Zyngier
2014-07-08 13:10 ` [PATCH 11/15] irqchip: sun4i: " Marc Zyngier
2014-07-15  9:18   ` Antoine Ténart
2014-07-08 13:10 ` [PATCH 12/15] irqchip: versatile-fpga: " Marc Zyngier
2014-07-08 13:10 ` [PATCH 13/15] irqchip: vic: " Marc Zyngier
2014-07-08 13:10 ` [PATCH 14/15] irqchip: vt8500: " Marc Zyngier
2014-07-08 13:10 ` [PATCH 15/15] irqchip: zevio: " Marc Zyngier
2014-07-11 20:38 ` [PATCH 00/15] arm/arm64: fix use of irq_find_mapping outside of legal RCU context Christopher Covington
2014-07-29 14:28   ` Marc Zyngier

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=1404825038-547-1-git-send-email-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).