From nobody Thu Apr 2 18:46:14 2026 Received: from out198-37.us.a.mail.aliyun.com (out198-37.us.a.mail.aliyun.com [47.90.198.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9549219ABC6 for ; Fri, 27 Mar 2026 08:12:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=47.90.198.37 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774599136; cv=none; b=MHAzVy1wftDeVpniOIeafxSzl8d79J7lapwsnKRN2MmLLiQMoKpLMgTpZU94ESl5GmsZNOEg9bqtVnHY5AN6mOaJYV/opfQIQX+jnIHXRuEEWTepoc9kqHdR7F4kK7QIv398Jr9o1TKFoWfgx4fGuDuir19HwXGWQznll6FJPh8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774599136; c=relaxed/simple; bh=sxgmmB/s8dU0sog7lx+d0UeghLAKezo0fo702m0l6r8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PIKdUoZo7UdIDVJ6kGY8Slbfzp7Hf5F8zHVBXtvVOvJuf3m6Ol9+Xrj/+wLEKpzOJi3vPRRVvUtLmvcwOCujKaoKXSpBBypz605eNdV3sUYP6uY+Rx6P4kNf8w0z+qufs771I36Z6k1nS0+G5a6CPuJrvsWjccjllcPlNZGf29M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=open-hieco.net; spf=pass smtp.mailfrom=open-hieco.net; arc=none smtp.client-ip=47.90.198.37 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=open-hieco.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=open-hieco.net X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07662987|-1;CH=blue;DM=|OVERLOAD|false|;DS=CONTINUE|ham_regular_dialog|0.0156302-0.00341411-0.980956;FP=1117291624617476391|4|1|1|0|-1|-1|-1;HT=maildocker-contentspam033037017159;MF=fuhao@open-hieco.net;NM=1;PH=DS;RN=7;RT=7;SR=0;TI=SMTPD_---.h.ByvTR_1774599111; Received: from higon..(mailfrom:fuhao@open-hieco.net fp:SMTPD_---.h.ByvTR_1774599111 cluster:ay29) by smtp.aliyun-inc.com; Fri, 27 Mar 2026 16:11:56 +0800 From: Fu Hao To: joro@8bytes.org, will@kernel.org, suravee.suthikulpanit@amd.com, robin.murphy@arm.com Cc: linux-kernel@vger.kernel.org, iommu@lists.linux.dev, Fu Hao Subject: [PATCH 8/8] iommu/hygon: Add support for Hygon family 18h model 4h IOAPIC Date: Fri, 27 Mar 2026 16:11:46 +0800 Message-Id: <314f4dff30610306c10e8de17509fca291411841.1774595153.git.fuhao@open-hieco.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The SB IOAPIC is on the device 0xb from Hygon family 18h model 4h. Signed-off-by: Fu Hao --- drivers/iommu/amd/init.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index f3fd7f39e..568851cc2 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -3096,6 +3096,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)) =20 +/* 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 =3D FW_BUG; @@ -3121,7 +3124,12 @@ static bool __init check_ioapic_information(void) pr_err("%s: IOAPIC[%d] not in IVRS table\n", fw_bug, id); ret =3D false; - } else if (devid =3D=3D IOAPIC_SB_DEVID) { + } else if (devid =3D=3D IOAPIC_SB_DEVID || + (boot_cpu_data.x86_vendor =3D=3D X86_VENDOR_HYGON && + boot_cpu_data.x86 =3D=3D 0x18 && + boot_cpu_data.x86_model >=3D 0x4 && + boot_cpu_data.x86_model <=3D 0xf && + devid =3D=3D IOAPIC_SB_DEVID_FAM18H_M4H)) { has_sb_ioapic =3D true; ret =3D true; } --=20 2.34.1