linux-stable/kernel/irq
Mark Rutland 2fe35f8ee7 irq: add a (temporary) CONFIG_HANDLE_DOMAIN_IRQ_IRQENTRY
Going forward we want architecture/entry code to perform all the
necessary work to enter/exit IRQ context, with irqchip code merely
handling the mapping of the interrupt to any handler(s). Among other
reasons, this is necessary to consistently fix some longstanding issues
with the ordering of lockdep/RCU/tracing instrumentation which many
architectures get wrong today in their entry code.

Importantly, rcu_irq_{enter,exit}() must be called precisely once per
IRQ exception, so that rcu_is_cpu_rrupt_from_idle() can correctly
identify when an interrupt was taken from an idle context which must be
explicitly preempted. Currently handle_domain_irq() calls
rcu_irq_{enter,exit}() via irq_{enter,exit}(), but entry code needs to
be able to call rcu_irq_{enter,exit}() earlier for correct ordering
across lockdep/RCU/tracing updates for sequences such as:

  lockdep_hardirqs_off(CALLER_ADDR0);
  rcu_irq_enter();
  trace_hardirqs_off_finish();

To permit each architecture to be converted to the new style in turn,
this patch adds a new CONFIG_HANDLE_DOMAIN_IRQ_IRQENTRY selected by all
current users of HANDLE_DOMAIN_IRQ, which gates the existing behaviour.
When CONFIG_HANDLE_DOMAIN_IRQ_IRQENTRY is not selected,
handle_domain_irq() requires entry code to perform the
irq_{enter,exit}() work, with an explicit check for this matching the
style of handle_domain_nmi().

Subsequent patches will:

1) Add the necessary IRQ entry accounting to each architecture in turn,
   dropping CONFIG_HANDLE_DOMAIN_IRQ_IRQENTRY from that architecture's
   Kconfig.

2) Remove CONFIG_HANDLE_DOMAIN_IRQ_IRQENTRY once it is no longer
   selected.

3) Convert irqchip drivers to consistently use
   generic_handle_domain_irq() rather than handle_domain_irq().

4) Remove handle_domain_irq() and CONFIG_HANDLE_DOMAIN_IRQ.

... which should leave us with a clear split of responsiblity across the
entry and irqchip code, making it possible to perform additional
cleanups and fixes for the aforementioned longstanding issues with entry
code.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
2021-10-25 10:05:30 +01:00
..
affinity.c genirq/affinity: Replace deprecated CPU-hotplug functions. 2021-08-10 14:51:26 +02:00
autoprobe.c genirq: Delay deactivation in free_irq() 2019-07-03 10:12:28 +02:00
chip.c genirq: Provide IRQCHIP_AFFINITY_PRE_STARTUP 2021-08-10 10:59:20 +02:00
cpuhotplug.c genirq/cpuhotplug: Demote debug printk to KERN_DEBUG 2021-08-24 09:16:20 +02:00
debug.h
debugfs.c Merge branch 'irq/qcom-pdc-wakeup' into irq/irqchip-next 2020-10-06 11:28:03 +01:00
devres.c genirq/devres: Use struct_size() in devm_kzalloc() 2019-04-16 21:54:03 +02:00
dummychip.c irq: Fix typos in comments 2021-03-22 04:23:14 +01:00
generic-chip.c genirq/generic_chip: Use struct_size() in kzalloc() 2021-08-10 15:35:20 +02:00
handle.c irq: add generic_handle_arch_irq() 2021-10-25 10:05:27 +01:00
internals.h genirq/chip: Use the first chip in irq_chip_compose_msi_msg() 2020-09-16 16:52:28 +02:00
ipi.c genirq: Fix kernel-doc warnings in pm.c, msi.c and ipi.c 2021-08-11 14:33:35 +02:00
irq_sim.c The usual updates from the irq departement: 2021-04-26 09:43:16 -07:00
irqdesc.c irq: add a (temporary) CONFIG_HANDLE_DOMAIN_IRQ_IRQENTRY 2021-10-25 10:05:30 +01:00
irqdomain.c irqchip fixes for 5.15, take #1 2021-09-24 14:11:04 +02:00
Kconfig irq: add a (temporary) CONFIG_HANDLE_DOMAIN_IRQ_IRQENTRY 2021-10-25 10:05:30 +01:00
Makefile genirq/timings: Add selftest for circular array 2019-06-12 10:47:04 +02:00
manage.c genirq: Fix kernel doc indentation 2021-08-13 12:45:13 +02:00
matrix.c genirq/matrix: Fix kernel doc warnings for irq_matrix_alloc_managed() 2021-08-10 22:50:07 +02:00
migration.c genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00
msi.c Updates to the interrupt core and driver subsystems: 2021-08-30 14:38:37 -07:00
pm.c genirq: Fix kernel-doc warnings in pm.c, msi.c and ipi.c 2021-08-11 14:33:35 +02:00
proc.c genirq: Improve "hwirq" output in /proc and /sys/ 2021-07-30 23:07:31 +02:00
resend.c genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00
settings.h genirq: Add a IRQF_NO_DEBUG flag 2021-05-17 20:01:35 +02:00
spurious.c genirq: Reduce irqdebug cacheline bouncing 2021-04-10 13:35:54 +02:00
timings.c Updates to the interrupt core and driver subsystems: 2021-08-30 14:38:37 -07:00