Skip to content

iommu/amd: Fix and improve SB IOAPIC IVRS validation

Wei Wang linux-iommu lkml 2 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am SI2PR01MB4393F989AF7FBFC94C304E61DCF52@SI2PR01MB4393.apcprd01.prod.exchangelabs.com

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyApplied
  2. v13 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Rebase to 7.2.0-rc1
- Add Tested-by from Yongwei Xu and Reviewed-by Vasant Hegde Thanks!

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3iommu/amd: Prevent SB IOAPIC from overriding IVRS validation errorsdrivers/iommu/amd/init.c+2 -20 replies
2/3iommu/amd: Fix false positive in SB IOAPIC IVRS validationdrivers/iommu/amd/init.c+28 -40 replies
3/3iommu/amd: Dynamically verify Southbridge IOAPIC via PCI config spacedrivers/iommu/amd/init.c+15 -100 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchYongwei XuVasant Hegde
1/3T-b R-b
2/3T-b R-b
3/3T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] iommu/amd: Fix and improve SB IOAPIC IVRS validation

The check_ioapic_information() function validates that the Southbridge (SB) IOAPIC is correctly listed in the IVRS table before enabling Interrupt Remapping (IR). If validation fails, IR is disabled to avoid IOMMU dropping interrupts from unmapped devices.

This series fixes three independent bugs in that function:

Patch 1 fixes a logic error where successfully detecting the SB IOAPIC resets a 'ret' flag that was previously cleared by an unmapped secondary (i.e., non-SB) IOAPIC. This causes IR to stay enabled when it should have been disabled, leading to localized device hangs.

Patch 2 fixes a false positive: the SB IOAPIC was identified solely by its devid matching the hardcoded value (00:14.0). If a buggy BIOS assigns that devid to a secondary IOAPIC in the IVRS while the real SB IOAPIC gets a different mapping, the check passes anyway and IR is left enabled. The system timer's interrupts then get dropped by the IOMMU, causing a silent boot hang. The fix identifies the SB IOAPIC by its APIC ID (the IOAPIC that owns GSI 0) before matching its devid.

Patch 3 removes the hardcoded SB IOAPIC devid entirely and replaces it with a dynamic PCI config‑space check. The SB IOAPIC resides in the FCH (Fusion Controller Hub / Southbridge), which typically exposes itself as an SMBus controller function. For example:

AMD Genoa:
00:14.0 SMBus: Advanced Micro Devices, Inc. FCH SMBus Controller

Hygon Gen4:
00:0b.0 SMBus: Chengdu Haiguang IC Design Co., Ltd. FCH SMBus Controller

The PCI class code at a given BDF is a stable, specification-defined property. Using it to identify an FCH function avoids maintaining per-vendor/per-generation hardcoded device IDs that must be updated for new platforms, while producing the same safe fallback (IR disabled) if the check ever fails.

v1->v2 changes:
- Rebase to 7.2.0-rc1
- Add Tested-by from Yongwei Xu and Reviewed-by Vasant Hegde Thanks!

Wei Wang (3):
iommu/amd: Prevent SB IOAPIC from overriding IVRS validation errors iommu/amd: Fix false positive in SB IOAPIC IVRS validation iommu/amd: Dynamically verify Southbridge IOAPIC via PCI config space

 drivers/iommu/amd/init.c | 57 ++++++++++++++++++++++++++++++----------
 1 file changed, 43 insertions(+), 14 deletions(-)

base-commit: 4f441960e691d37c880d2cc004de06bb5b6bd5e4

Signature · 1 line
2.51.0