All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/19] irqdomain: fix mapping race and clean up locking
@ 2023-01-16 13:50 ` Johan Hovold
  0 siblings, 0 replies; 88+ messages in thread
From: Johan Hovold @ 2023-01-16 13:50 UTC (permalink / raw)
  To: Marc Zyngier, Thomas Gleixner
  Cc: x86, platform-driver-x86, linux-arm-kernel, linux-mips,
	linux-kernel, Johan Hovold

Parallel probing (e.g. due to asynchronous probing) of devices that
share interrupts can currently result in two mappings for the same
hardware interrupt to be created.

This series fixes this mapping race and clean up the irqdomain locking
so that in the end the global irq_domain_mutex is only used for managing
the likewise global irq_domain_list, while domain operations (e.g.
IRQ allocations) use per-domain (hierarchy) locking.

Johan


Changes in v4
 - add a comment to __irq_domain_add() as further documentation of the
   domain lock and root pointer (19/19)
 - add a comment documenting that the lockdep assertion in
   irq_domain_set_mapping() also verifies that the domains in a
   hierarchy point to the same root (19/19)

Changes in v3
 - drop dead and bogus code (1--3/19, new)
 - fix racy mapcount accesses (5/19, new)
 - drop revmap mutex (6/19, new)
 - use irq_domain_mutex to address mapping race (9/19)
 - clean up irq_domain_push/pop_irq() (10/19, new)
 - use irq_domain_create_hierarchy() to construct hierarchies
   (11--18/19, new)
 - switch to per-domain locking (19/19, new)

Changes in v2
 - split out redundant-lookup cleanup (1/4)
 - use a per-domain mutex to address mapping race (2/4)
 - move kernel-doc to exported function (2/4)
 - fix association race (3/4, new)
 - use per-domain mutex for associations (4/4, new)


Johan Hovold (19):
  irqdomain: Drop bogus fwspec-mapping error handling
  irqdomain: Drop dead domain-name assignment
  irqdomain: Drop leftover brackets
  irqdomain: Fix association race
  irqdomain: Fix disassociation race
  irqdomain: Drop revmap mutex
  irqdomain: Look for existing mapping only once
  irqdomain: Refactor __irq_domain_alloc_irqs()
  irqdomain: Fix mapping-creation race
  irqdomain: Clean up irq_domain_push/pop_irq()
  x86/ioapic: Use irq_domain_create_hierarchy()
  x86/apic: Use irq_domain_create_hierarchy()
  irqchip/alpine-msi: Use irq_domain_add_hierarchy()
  irqchip/gic-v2m: Use irq_domain_create_hierarchy()
  irqchip/gic-v3-its: Use irq_domain_create_hierarchy()
  irqchip/gic-v3-mbi: Use irq_domain_create_hierarchy()
  irqchip/loongson-pch-msi: Use irq_domain_create_hierarchy()
  irqchip/mvebu-odmi: Use irq_domain_create_hierarchy()
  irqdomain: Switch to per-domain locking

 arch/x86/kernel/apic/io_apic.c         |   8 +-
 arch/x86/platform/uv/uv_irq.c          |   7 +-
 drivers/irqchip/irq-alpine-msi.c       |   8 +-
 drivers/irqchip/irq-gic-v2m.c          |   5 +-
 drivers/irqchip/irq-gic-v3-its.c       |  13 +-
 drivers/irqchip/irq-gic-v3-mbi.c       |   5 +-
 drivers/irqchip/irq-loongson-pch-msi.c |   9 +-
 drivers/irqchip/irq-mvebu-odmi.c       |  13 +-
 include/linux/irqdomain.h              |   6 +-
 kernel/irq/irqdomain.c                 | 341 ++++++++++++++-----------
 10 files changed, 233 insertions(+), 182 deletions(-)

-- 
2.38.2


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

end of thread, other threads:[~2023-02-09 13:08 UTC | newest]

Thread overview: 88+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-16 13:50 [PATCH v4 00/19] irqdomain: fix mapping race and clean up locking Johan Hovold
2023-01-16 13:50 ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 01/19] irqdomain: Drop bogus fwspec-mapping error handling Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-17 21:17   ` Thomas Gleixner
2023-01-17 21:17     ` Thomas Gleixner
2023-01-16 13:50 ` [PATCH v4 02/19] irqdomain: Drop dead domain-name assignment Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-17 21:18   ` Thomas Gleixner
2023-01-17 21:18     ` Thomas Gleixner
2023-01-16 13:50 ` [PATCH v4 03/19] irqdomain: Drop leftover brackets Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-17 21:19   ` Thomas Gleixner
2023-01-17 21:19     ` Thomas Gleixner
2023-01-18  9:05     ` Johan Hovold
2023-01-18  9:05       ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 04/19] irqdomain: Fix association race Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-17 21:20   ` Thomas Gleixner
2023-01-17 21:20     ` Thomas Gleixner
2023-01-16 13:50 ` [PATCH v4 05/19] irqdomain: Fix disassociation race Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 06/19] irqdomain: Drop revmap mutex Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-17 21:23   ` Thomas Gleixner
2023-01-17 21:23     ` Thomas Gleixner
2023-01-18  9:22     ` Johan Hovold
2023-01-18  9:22       ` Johan Hovold
2023-01-18 13:05       ` Thomas Gleixner
2023-01-18 13:05         ` Thomas Gleixner
2023-01-18 13:10         ` Johan Hovold
2023-01-18 13:10           ` Johan Hovold
2023-02-06 13:09           ` Thomas Gleixner
2023-02-06 13:09             ` Thomas Gleixner
2023-02-06 17:10             ` Johan Hovold
2023-02-06 17:10               ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 07/19] irqdomain: Look for existing mapping only once Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-17 21:34   ` Thomas Gleixner
2023-01-17 21:34     ` Thomas Gleixner
2023-01-18  9:26     ` Johan Hovold
2023-01-18  9:26       ` Johan Hovold
2023-02-09 13:00       ` Johan Hovold
2023-02-09 13:00         ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 08/19] irqdomain: Refactor __irq_domain_alloc_irqs() Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-17 21:34   ` Thomas Gleixner
2023-01-17 21:34     ` Thomas Gleixner
2023-01-18  9:30     ` Johan Hovold
2023-01-18  9:30       ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 09/19] irqdomain: Fix mapping-creation race Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-17 21:39   ` Thomas Gleixner
2023-01-17 21:39     ` Thomas Gleixner
2023-01-18  9:40     ` Johan Hovold
2023-01-18  9:40       ` Johan Hovold
2023-02-09 13:08       ` Johan Hovold
2023-02-09 13:08         ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 10/19] irqdomain: Clean up irq_domain_push/pop_irq() Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 11/19] x86/ioapic: Use irq_domain_create_hierarchy() Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-17 21:41   ` Thomas Gleixner
2023-01-17 21:41     ` Thomas Gleixner
2023-01-18 10:31     ` Johan Hovold
2023-01-18 10:31       ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 12/19] x86/apic: " Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 13/19] irqchip/alpine-msi: Use irq_domain_add_hierarchy() Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 14/19] irqchip/gic-v2m: Use irq_domain_create_hierarchy() Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 15/19] irqchip/gic-v3-its: " Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 16/19] irqchip/gic-v3-mbi: " Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 17/19] irqchip/loongson-pch-msi: " Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 18/19] irqchip/mvebu-odmi: " Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-16 13:50 ` [PATCH v4 19/19] irqdomain: Switch to per-domain locking Johan Hovold
2023-01-16 13:50   ` Johan Hovold
2023-01-17 21:50   ` Thomas Gleixner
2023-01-17 21:50     ` Thomas Gleixner
2023-01-18  9:51     ` Johan Hovold
2023-01-18  9:51       ` Johan Hovold
2023-01-18 13:09       ` Thomas Gleixner
2023-01-18 13:09         ` Thomas Gleixner

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.