All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 00/20] irqdomain: fix mapping race and rework locking
@ 2023-02-13 10:42 ` Johan Hovold
  0 siblings, 0 replies; 73+ messages in thread
From: Johan Hovold @ 2023-02-13 10:42 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 reworks 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 v6
 - use common exit path in irq_create_fwspec_mapping() (6/20)
 - fix domain registration race (7/20, new)
 - fix x86/uv commit prefix (13/20)
 - use &domain->root->mutex also for non-hierarchichal domains (20/20)
 - fix kernel doc typo (20/20)

Changes in v5
 - reorder patches (since we do care about stable after all)
 - tweak commit messages and add stable tags
 - use '__locked' suffix for new helper functions
 - drop a line break from an argument list (11/19)

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: Fix association race
  irqdomain: Fix disassociation race
  irqdomain: Drop bogus fwspec-mapping error handling
  irqdomain: Look for existing mapping only once
  irqdomain: Refactor __irq_domain_alloc_irqs()
  irqdomain: Fix mapping-creation race
  irqdomain: Drop revmap mutex
  irqdomain: Drop dead domain-name assignment
  irqdomain: Drop leftover brackets
  irqdomain: Clean up irq_domain_push/pop_irq()
  x86/ioapic: Use irq_domain_create_hierarchy()
  x86/uv: 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

Marc Zyngier (1):
  irqdomain: Fix domain registration race

 arch/x86/kernel/apic/io_apic.c         |   7 +-
 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                 | 408 +++++++++++++++----------
 10 files changed, 279 insertions(+), 202 deletions(-)

-- 
2.39.1


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

end of thread, other threads:[~2023-03-09  7:32 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-13 10:42 [PATCH v6 00/20] irqdomain: fix mapping race and rework locking Johan Hovold
2023-02-13 10:42 ` Johan Hovold
2023-02-13 10:42 ` [PATCH v6 01/20] irqdomain: Fix association race Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 02/20] irqdomain: Fix disassociation race Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 03/20] irqdomain: Drop bogus fwspec-mapping error handling Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 04/20] irqdomain: Look for existing mapping only once Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 05/20] irqdomain: Refactor __irq_domain_alloc_irqs() Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 06/20] irqdomain: Fix mapping-creation race Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-03-08 14:41   ` Cyril Brulebois
2023-03-08 14:41     ` Cyril Brulebois
2023-03-08 14:53     ` Marc Zyngier
2023-03-08 14:53       ` Marc Zyngier
2023-03-09  7:32     ` Johan Hovold
2023-03-09  7:32       ` Johan Hovold
2023-02-13 10:42 ` [PATCH v6 07/20] irqdomain: Fix domain registration race Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Marc Zyngier
2023-02-13 10:42 ` [PATCH v6 08/20] irqdomain: Drop revmap mutex Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 09/20] irqdomain: Drop dead domain-name assignment Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 10/20] irqdomain: Drop leftover brackets Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 11/20] irqdomain: Clean up irq_domain_push/pop_irq() Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 12/20] x86/ioapic: Use irq_domain_create_hierarchy() Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 13/20] x86/uv: " Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 14/20] irqchip/alpine-msi: Use irq_domain_add_hierarchy() Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 15/20] irqchip/gic-v2m: Use irq_domain_create_hierarchy() Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 16/20] irqchip/gic-v3-its: " Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:42 ` [PATCH v6 17/20] irqchip/gic-v3-mbi: " Johan Hovold
2023-02-13 10:42   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:43 ` [PATCH v6 18/20] irqchip/loongson-pch-msi: " Johan Hovold
2023-02-13 10:43   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:43 ` [PATCH v6 19/20] irqchip/mvebu-odmi: " Johan Hovold
2023-02-13 10:43   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-02-13 10:43 ` [PATCH v6 20/20] irqdomain: Switch to per-domain locking Johan Hovold
2023-02-13 10:43   ` Johan Hovold
2023-02-13 19:40   ` [irqchip: irq/irqchip-next] " irqchip-bot for Johan Hovold
2023-03-07 13:51   ` [PATCH v6 20/20] " David Woodhouse
2023-03-07 13:51     ` David Woodhouse
2023-03-07 14:06     ` Juergen Gross
2023-03-07 14:06       ` Juergen Gross
2023-03-07 14:18       ` David Woodhouse
2023-03-07 14:18         ` David Woodhouse

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.