]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommu/amd: Add support for Hygon family 18h model 4h IOAPIC
authorFu Hao <fuhao@open-hieco.net>
Tue, 7 Apr 2026 08:25:40 +0000 (16:25 +0800)
committerJoerg Roedel <joerg.roedel@amd.com>
Mon, 11 May 2026 07:42:56 +0000 (09:42 +0200)
The SB IOAPIC is on the device 0xb from Hygon family 18h model 4h.

Signed-off-by: Fu Hao <fuhao@open-hieco.net>
Tested-by: Tingyin Duan <tingyin.duan@gmail.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/amd/init.c

index d146fa2f57aede1378f27bac53677d0c967a1cee..16073b5614b9896478e3406362d76559e1ae089e 100644 (file)
@@ -3089,6 +3089,9 @@ static void __init free_iommu_resources(void)
 /* SB IOAPIC is always on this device in AMD systems */
 #define IOAPIC_SB_DEVID                ((0x00 << 8) | PCI_DEVFN(0x14, 0))
 
+/* SB IOAPIC for Hygon family 18h model 4h is on the device 0xb */
+#define IOAPIC_SB_DEVID_FAM18H_M4H     ((0x00 << 8) | PCI_DEVFN(0xb, 0))
+
 static bool __init check_ioapic_information(void)
 {
        const char *fw_bug = FW_BUG;
@@ -3114,7 +3117,12 @@ static bool __init check_ioapic_information(void)
                        pr_err("%s: IOAPIC[%d] not in IVRS table\n",
                                fw_bug, id);
                        ret = false;
-               } else if (devid == IOAPIC_SB_DEVID) {
+               } else if (devid == IOAPIC_SB_DEVID ||
+                          (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON &&
+                           boot_cpu_data.x86 == 0x18 &&
+                           boot_cpu_data.x86_model >= 0x4 &&
+                           boot_cpu_data.x86_model <= 0xf &&
+                           devid == IOAPIC_SB_DEVID_FAM18H_M4H)) {
                        has_sb_ioapic = true;
                        ret           = true;
                }