Skip to content

RFC Enable hierarchy irqdomian on x86 platforms

Jiang Liu linux-acpi linux-arm-kernel linux-pci lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest21 patches 21 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21irqdomain: Introduce new interfaces to support hierarchy irqdomainsinclude/linux/irq.h include/linux/irqdomain.h kernel/irq/Kconfig +2 more+404 -1411 replies
2/21genirq: Introduce helper functions to support stacked irq_chipinclude/linux/irq.h kernel/irq/chip.c+23 -04 replies
3/21x86, irq: Save destination CPU ID in irq_cfgarch/x86/include/asm/hw_irq.h arch/x86/kernel/apic/vector.c+5 -02 replies
4/21x86, irq: Use hierarchy irqdomain to manage CPU interrupt vectorsarch/x86/Kconfig arch/x86/include/asm/hw_irq.h arch/x86/kernel/apic/io_apic.c +1 more+150 -170 replies
5/21x86, hpet: Use new irqdomain interfaces to allocate/free IRQarch/x86/kernel/hpet.c+5 -30 replies
6/21x86, MSI: Use new irqdomain interfaces to allocate/free IRQarch/x86/kernel/apic/msi.c+6 -80 replies
7/21x86, uv: Use new irqdomain interfaces to allocate/free IRQarch/x86/platform/uv/uv_irq.c+11 -160 replies
8/21x86, htirq: Use new irqdomain interfaces to allocate/free IRQarch/x86/kernel/apic/htirq.c drivers/pci/htirq.c include/linux/htirq.h+18 -170 replies
9/21x86, dmar: Use new irqdomain interfaces to allocate/free IRQarch/x86/include/asm/irq_remapping.h arch/x86/kernel/apic/msi.c drivers/iommu/irq_remapping.c+27 -40 replies
10/21x86: irq_remapping: Introduce new interfaces to support hierarchy irqdomainarch/x86/include/asm/hw_irq.h arch/x86/include/asm/irq_remapping.h drivers/iommu/irq_remapping.c +1 more+182 -20 replies
11/21iommu/vt-d: Change prototypes to prepare for enabling hierarchy irqdomaindrivers/iommu/intel_irq_remapping.c+11 -110 replies
12/21iommu/vt-d: Enhance Intel IR driver to suppport hierarchy irqdomaindrivers/iommu/intel_irq_remapping.c include/linux/intel-iommu.h+340 -180 replies
13/21iommu/amd: Enhance AMD IR driver to suppport hierarchy irqdomaindrivers/iommu/amd_iommu.c drivers/iommu/amd_iommu_init.c drivers/iommu/amd_iommu_proto.h +1 more+350 -60 replies
14/21x86, hpet: Enhance HPET IRQ to support hierarchy irqdomainarch/x86/include/asm/hpet.h arch/x86/kernel/apic/msi.c arch/x86/kernel/hpet.c+160 -602 replies
15/21x86, MSI: Use hierarchy irqdomain to manage MSI interruptsarch/x86/include/asm/hw_irq.h arch/x86/include/asm/irq_remapping.h arch/x86/kernel/apic/msi.c +2 more+204 -362 replies
16/21x86, irq: Directly call native_compose_msi_msg() for DMAR IRQarch/x86/kernel/apic/msi.c+2 -40 replies
17/21x86, htirq: Use hierarchy irqdomain to manage Hypertransport interruptsarch/x86/include/asm/hw_irq.h arch/x86/kernel/apic/htirq.c arch/x86/kernel/apic/vector.c +2 more+165 -870 replies
18/21iommu/vt-d: Clean up unused MSI related codedrivers/iommu/intel_irq_remapping.c+0 -1440 replies
19/21iommu/amd: Clean up unused MSI related codedrivers/iommu/amd_iommu.c+2 -1130 replies
20/21x86: irq_remapping: Clean up unused MSI related codearch/x86/include/asm/irq_remapping.h arch/x86/include/asm/pci.h arch/x86/kernel/x86_init.c +2 more+0 -1880 replies
21/21x86, irq: Clean up unused MSI related code and interfacesarch/x86/include/asm/hpet.h arch/x86/include/asm/x86_init.h arch/x86/kernel/apic/msi.c+6 -980 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC Part2 v1 00/21] Enable hierarchy irqdomian on x86 platforms

We plan to restructure x86 interrupt code based on hierarchy irqdomain, that is to build irqdomains for CPU vector, interrupt remapping unit, IOAPIC, MSI and HPET etc and organize those irqdomains in hierarchy mode. Each irqdomain manages corresponding interrupt controller and talks to parent interrupt controller through public irqdomain interfaces. We also support stacked irq_chip based on hierarchy irqdomain. It will make the x86 interrupt architecture much more clear and more easy to maintain with hierarchy irqdomain and stacked irq_chip. It may also help ARM interrupt management architecture too.

This is the second patch set to enable support of hierarchy irqdomain on x86 platforms. It depends on the first part at:
https://lkml.org/lkml/2014/9/11/101
And you may access it at:
https://github.com/jiangliu/linux.git irqdomain/p2v1

And there will be a third patch set to convert IOAPIC driver to support hierarchy irqdomain and clean up code.

The first patch extends irqdomain interfaces to support hierarchy irqdomain. Hope this interface could be used by other architectures too, such as ARM/ARM64.
The second patch introduces two helper functions to support stacked irq_chip.
Patch 3-9 implements an irqdomain to manange CPU interrupt vectors, and it's the root irqdomain for x86 platforms.
Patch 10-13 converts Intel and AMD interrupt remapping drivers to support hierarchy irqdomain.
Patch 14-17 converts HPET, MSI and HT_IRQ drivers to support hierarchy irqdomain.
Patch 18-21 cleans up unsued code in x86 arch and interrupt remapping drivers.

We have tested this patchset on Intel 32-bit and 64-bit systems. But we have only done compilation tests for HT_IRQ and AMD interrupt remapping drivers due to hardware resource limitation. Tests on AMD platforms are warmly welcomed!

Jiang Liu (21):
irqdomain: Introduce new interfaces to support hierarchy irqdomains
genirq: Introduce helper functions to support stacked irq_chip x86, irq: Save destination CPU ID in irq_cfg
x86, irq: Use hierarchy irqdomain to manage CPU interrupt vectors x86, hpet: Use new irqdomain interfaces to allocate/free IRQ x86, MSI: Use new irqdomain interfaces to allocate/free IRQ x86, uv: Use new irqdomain interfaces to allocate/free IRQ x86, htirq: Use new irqdomain interfaces to allocate/free IRQ x86, dmar: Use new irqdomain interfaces to allocate/free IRQ
x86: irq_remapping: Introduce new interfaces to support hierarchy
irqdomain
iommu/vt-d: Change prototypes to prepare for enabling hierarchy
irqdomain
iommu/vt-d: Enhance Intel IR driver to suppport hierarchy irqdomain iommu/amd: Enhance AMD IR driver to suppport hierarchy irqdomain x86, hpet: Enhance HPET IRQ to support hierarchy irqdomain x86, MSI: Use hierarchy irqdomain to manage MSI interrupts x86, irq: Directly call native_compose_msi_msg() for DMAR IRQ x86, htirq: Use hierarchy irqdomain to manage Hypertransport
interrupts
iommu/vt-d: Clean up unused MSI related code
iommu/amd: Clean up unused MSI related code
x86: irq_remapping: Clean up unused MSI related code x86, irq: Clean up unused MSI related code and interfaces

 arch/x86/Kconfig                     |    3 +-
 arch/x86/include/asm/hpet.h          |   16 +-
 arch/x86/include/asm/hw_irq.h        |   64 +++++
 arch/x86/include/asm/irq_remapping.h |   66 +++--
 arch/x86/include/asm/pci.h           |    5 -
 arch/x86/include/asm/x86_init.h      |    4 -
 arch/x86/kernel/apic/htirq.c         |  179 +++++++++----
 arch/x86/kernel/apic/io_apic.c       |    3 -
 arch/x86/kernel/apic/msi.c           |  430 +++++++++++++++++++++++--------
 arch/x86/kernel/apic/vector.c        |  158 +++++++++++-
 arch/x86/kernel/hpet.c               |   57 ++---
 arch/x86/kernel/x86_init.c           |    2 -
 arch/x86/platform/uv/uv_irq.c        |   27 +-
 drivers/iommu/amd_iommu.c            |  385 ++++++++++++++++++++++------
 drivers/iommu/amd_iommu_init.c       |    4 +
 drivers/iommu/amd_iommu_proto.h      |    9 +
 drivers/iommu/amd_iommu_types.h      |    5 +
 drivers/iommu/intel_irq_remapping.c  |  468 +++++++++++++++++++++++-----------
 drivers/iommu/irq_remapping.c        |  221 ++++++----------
 drivers/iommu/irq_remapping.h        |   22 +-
 drivers/pci/htirq.c                  |   48 +---
 include/linux/htirq.h                |   22 +-
 include/linux/intel-iommu.h          |    4 +
 include/linux/irq.h                  |    8 +
 include/linux/irqdomain.h            |   60 +++++
 kernel/irq/Kconfig                   |    3 +
 kernel/irq/chip.c                    |   21 ++
 kernel/irq/irqdomain.c               |  349 ++++++++++++++++++++++++-
 28 files changed, 1934 insertions(+), 709 deletions(-)
Signature · 1 line
1.7.10.4