Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH] iommu/amd: Skip the southbridge IOAPIC PCI class check in guests
@ 2026-12-01  7:53 Wei Wang
  2026-12-02  9:51 ` Vasant Hegde
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Wang @ 2026-12-01  7:53 UTC (permalink / raw)
  To: vasant.hegde, joro, suravee.suthikulpanit, will, robin.murphy,
	artem.anisimov.255
  Cc: iommu, linux-kernel, Wei Wang, stable

Linux 7.3 hangs during boot in a VMware ESXi 7.0U3 guest with the virtual
IOMMU enabled. IVRS reports 00:14.0 as the source ID for the southbridge
IOAPIC, but reading the PCI class at that address returns 0xffff. The PCI
class check therefore rejects a valid mapping, causing Linux to disable
interrupt remapping.

On bare metal, the PCI class provides a sanity check that the source ID
corresponds to a southbridge function. In a VM, the VMM typically supplies
both the IVRS mapping and the source ID used by the emulated IOAPIC. That
ID need not correspond to a guest-visible PCI function.

Skip the PCI class check when the CPU advertises a hypervisor. The driver
still requires a source-ID mapping for each IOAPIC. With the check skipped,
the guest boots with interrupt remapping enabled.

Fixes: 16f52863b2ec ("iommu/amd: Dynamically verify Southbridge IOAPIC via PCI config space")
Reported-by: Artem Anisimov <artem.anisimov.255@gmail.com>
Closes: https://lore.kernel.org/r/d5646630-9f56-4b29-b0e5-56f5052f9f75@gmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Wei Wang <wei.w.wang@hotmail.com>
---
 drivers/iommu/amd/init.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index 69f38ca8ff87..a7f7e9e7e96c 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -3208,6 +3208,14 @@ static bool __init check_sb_ioapic(int devid)
 	u8 devfn = devid & 0xff;
 	u16 val;
 
+	/*
+	 * A virtual IOAPIC may use a source ID with no corresponding PCI
+	 * function. Skip the PCI class check in guests and accept the source
+	 * ID from IVRS.
+	 */
+	if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
+		return true;
+
 	val = read_pci_config_16(bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
 				 PCI_CLASS_DEVICE);
 

base-commit: 253f86660c1f882fbf554db5eaa34bc5d66dc7e8
-- 
2.51.0


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

* Re: [PATCH] iommu/amd: Skip the southbridge IOAPIC PCI class check in guests
  2026-12-01  7:53 [PATCH] iommu/amd: Skip the southbridge IOAPIC PCI class check in guests Wei Wang
@ 2026-12-02  9:51 ` Vasant Hegde
  0 siblings, 0 replies; 2+ messages in thread
From: Vasant Hegde @ 2026-12-02  9:51 UTC (permalink / raw)
  To: Wei Wang, joro, suravee.suthikulpanit, will, robin.murphy,
	artem.anisimov.255
  Cc: iommu, linux-kernel, stable



On 12/1/2026 1:23 PM, Wei Wang wrote:
> Linux 7.3 hangs during boot in a VMware ESXi 7.0U3 guest with the virtual
> IOMMU enabled. IVRS reports 00:14.0 as the source ID for the southbridge
> IOAPIC, but reading the PCI class at that address returns 0xffff. The PCI
> class check therefore rejects a valid mapping, causing Linux to disable
> interrupt remapping.
> 
> On bare metal, the PCI class provides a sanity check that the source ID
> corresponds to a southbridge function. In a VM, the VMM typically supplies
> both the IVRS mapping and the source ID used by the emulated IOAPIC. That
> ID need not correspond to a guest-visible PCI function.
> 
> Skip the PCI class check when the CPU advertises a hypervisor. The driver
> still requires a source-ID mapping for each IOAPIC. With the check skipped,
> the guest boots with interrupt remapping enabled.
> 
> Fixes: 16f52863b2ec ("iommu/amd: Dynamically verify Southbridge IOAPIC via PCI config space")
> Reported-by: Artem Anisimov <artem.anisimov.255@gmail.com>
> Closes: https://lore.kernel.org/r/d5646630-9f56-4b29-b0e5-56f5052f9f75@gmail.com
> Cc: stable@vger.kernel.org
> Signed-off-by: Wei Wang <wei.w.wang@hotmail.com>

Applied. Thanks!

-Vasant


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

end of thread, other threads:[~2026-12-02  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01  7:53 [PATCH] iommu/amd: Skip the southbridge IOAPIC PCI class check in guests Wei Wang
2026-12-02  9:51 ` Vasant Hegde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox