mirror-linux/drivers/iommu/intel
Thomas Gleixner 0edc78b82b x86/msi: Make irq_retrigger() functional for posted MSI
Luigi reported that retriggering a posted MSI interrupt does not work
correctly.

The reason is that the retrigger happens at the vector domain by sending an
IPI to the actual vector on the target CPU. That works correctly exactly
once because the posted MSI interrupt chip does not issue an EOI as that's
only required for the posted MSI notification vector itself.

As a consequence the vector becomes stale in the ISR, which not only
affects this vector but also any lower priority vector in the affected
APIC because the ISR bit is not cleared.

Luigi proposed to set the vector in the remap PIR bitmap and raise the
posted MSI notification vector. That works, but that still does not cure a
related problem:

  If there is ever a stray interrupt on such a vector, then the related
  APIC ISR bit becomes stale due to the lack of EOI as described above.
  Unlikely to happen, but if it happens it's not debuggable at all.

So instead of playing games with the PIR, this can be actually solved
for both cases by:

 1) Keeping track of the posted interrupt vector handler state

 2) Implementing a posted MSI specific irq_ack() callback which checks that
    state. If the posted vector handler is inactive it issues an EOI,
    otherwise it delegates that to the posted handler.

This is correct versus affinity changes and concurrent events on the posted
vector as the actual handler invocation is serialized through the interrupt
descriptor lock.

Fixes: ed1e48ea43 ("iommu/vt-d: Enable posted mode for device MSIs")
Reported-by: Luigi Rizzo <lrizzo@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Luigi Rizzo <lrizzo@google.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251125214631.044440658@linutronix.de
Closes: https://lore.kernel.org/lkml/20251124104836.3685533-1-lrizzo@google.com
2025-12-17 18:41:52 +01:00
..
Kconfig Merge branches 'arm/smmu/updates', 'arm/smmu/bindings', 'mediatek', 'nvidia/tegra', 'intel/vt-d', 'amd/amd-vi' and 'core' into next 2025-11-28 08:44:21 +01:00
Makefile
cache.c IOMMU Updates for Linux v6.17: 2025-07-30 10:42:00 -07:00
debugfs.c iommu/vt-d: debugfs: Avoid dumping context command register 2025-09-19 09:43:21 +02:00
dmar.c iommu/vt-d: Remove the CONFIG_X86 wrapping from iommu init hook 2025-07-14 11:18:03 +01:00
iommu.c soc: driver updates for 6.19 2025-12-05 17:29:04 -08:00
iommu.h Merge branches 'arm/smmu/updates', 'arm/smmu/bindings', 'mediatek', 'nvidia/tegra', 'intel/vt-d', 'amd/amd-vi' and 'core' into next 2025-11-28 08:44:21 +01:00
irq_remapping.c x86/msi: Make irq_retrigger() functional for posted MSI 2025-12-17 18:41:52 +01:00
nested.c iommu/vt-d: Use the generic iommu page table 2025-11-05 09:50:19 +01:00
pasid.c iommu/vt-d: Follow PT_FEAT_DMA_INCOHERENT into the PASID entry 2025-11-05 09:50:20 +01:00
pasid.h iommu/vt-d: Follow PT_FEAT_DMA_INCOHERENT into the PASID entry 2025-11-05 09:50:20 +01:00
perf.c iommu/vt-d: Replace snprintf with scnprintf in dmar_latency_snapshot() 2025-09-19 09:43:19 +02:00
perf.h iommu/vt-d: Replace snprintf with scnprintf in dmar_latency_snapshot() 2025-09-19 09:43:19 +02:00
perfmon.c
perfmon.h
prq.c iommu/vt-d: Remove LPIG from page group response descriptor 2025-09-19 09:43:20 +02:00
svm.c iommu/vt-d: Follow PT_FEAT_DMA_INCOHERENT into the PASID entry 2025-11-05 09:50:20 +01:00
trace.c
trace.h iommu/vt-d: Deduplicate cache_tag_flush_all by reusing flush_range 2025-07-14 11:18:04 +01:00