iommu/vt-d: Enable posted mode for device MSIs
authorJacob Pan <jacob.jun.pan@linux.intel.com>
Tue, 23 Apr 2024 17:41:14 +0000 (10:41 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 29 Apr 2024 22:54:43 +0000 (00:54 +0200)
commited1e48ea43703002dc202ac7f3b0b0b9981ec2f0
treee33a2e39c3a9ea043f8c2ffccb976926eeed68c6
parentbe9be07b22c96dc03d0ecc76b5a5f21c2dcb05a1
iommu/vt-d: Enable posted mode for device MSIs

With posted MSI feature enabled on the CPU side, iommu interrupt
remapping table entries (IRTEs) for device MSI/x can be allocated,
activated, and programed in posted mode. This means that IRTEs are
linked with their respective PIDs of the target CPU.

Handlers for the posted MSI notification vector will de-multiplex
device MSI handlers. CPU notifications are coalesced if interrupts
arrive at a high frequency.

Posted interrupts are only used for device MSI and not for legacy devices
(IO/APIC, HPET).

Introduce a new irq_chip for posted MSIs, which has a dummy irq_ack()
callback as EOI is performed in the notification handler once.

When posted MSI is enabled, MSI domain/chip hierarchy will look like
this example:

domain:  IR-PCI-MSIX-0000:50:00.0-12
 hwirq:   0x29
 chip:    IR-PCI-MSIX-0000:50:00.0
  flags:   0x430
             IRQCHIP_SKIP_SET_WAKE
             IRQCHIP_ONESHOT_SAFE
 parent:
    domain:  INTEL-IR-10-13
     hwirq:   0x2d0000
     chip:    INTEL-IR-POST
      flags:   0x0
     parent:
        domain:  VECTOR
         hwirq:   0x77
         chip:    APIC

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240423174114.526704-13-jacob.jun.pan@linux.intel.com
drivers/iommu/intel/irq_remapping.c