From nobody Tue Jun 9 00:49:57 2026 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) (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 11ADA286AC for ; Mon, 25 May 2026 03:48:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779680895; cv=none; b=TROLJVvWCs7mD52y8CAT/Sh4sW9vgkEE1ORyrUiq5gV3uZ+tqtIGwncIY5yqDotXL30zAuTdkcg8PNu6ASP2r9d6LUapvx+MFObT4xDt2bwyrupvGJ3xp+OhgT/WDmBohRIUMVQDh4YokS/k+a1b+I5Xlhy1TvmGyb9vN6ZnhH4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779680895; c=relaxed/simple; bh=TAOhXlHXz6ihP3yFKICFEHPF0JGvkVzEFhfh4t8MaUQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=T0crMoCW5oODVEWhNyxqebS7Eiv7HV6c0EgNDu7F+3ZdkcWVSemEPsA6Aqt8zu345FLcbkxMYE2D5BA2nYps660YE1SVWPDDTGPMrWlvfDImfroyzlMGwYV1ne7pNnDr293hYfUhkz74e0KjbNIAN4RvIOmN44TFGs6TDGDVZ+U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=ENmeF6cA; arc=none smtp.client-ip=115.124.30.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="ENmeF6cA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1779680885; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=LzYDX8FRhSqO0nYS8B6zvb4SGlG2cwar8vVaCKz3SDA=; b=ENmeF6cA7ERw1yvB2suEt5GPhjbfswA+bzRttAOEv+5PXYv9/7o9Ltp6Ztt6sKMutzWqLHYn08nNHEogw6b0ihVZrwwkB+jGrISoteptOWFRC08OqbtW6hiRWTej0EqS0jOfxqHaXfzcthDHvHchJe8+FIxydNt2lWALxZ+2Kz4= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam011083073210;MF=guanghuifeng@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0X3U4bE3_1779680875; Received: from VM20241011-104.tbsite.net(mailfrom:guanghuifeng@linux.alibaba.com fp:SMTPD_---0X3U4bE3_1779680875 cluster:ay36) by smtp.aliyun-inc.com; Mon, 25 May 2026 11:48:04 +0800 From: Guanghui Feng To: dwmw2@infradead.org, baolu.lu@linux.intel.com, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Cc: xlpang@linux.alibaba.com, oliver.yang@linux.alibaba.com Subject: [PATCH] iommu/vt-d: improve IOMMU fault information Date: Mon, 25 May 2026 11:47:55 +0800 Message-ID: <20260525034755.3645658-1-guanghuifeng@linux.alibaba.com> X-Mailer: git-send-email 2.43.7 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" In some environments, multiple PCIe segments exist, and PCIe device information needs to be differentiated and identified based on the segment. When an IOMMU fault event occurs, the IOMMU and device segment information should be output in detail in dmar_fault_do_one. Signed-off-by: Guanghui Feng --- drivers/iommu/intel/dmar.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c index d33c119a935e..ca9afbb55e76 100644 --- a/drivers/iommu/intel/dmar.c +++ b/drivers/iommu/intel/dmar.c @@ -1894,7 +1894,8 @@ static int dmar_fault_do_one(struct intel_iommu *iomm= u, int type, reason =3D dmar_get_fault_reason(fault_reason, &fault_type); =20 if (fault_type =3D=3D INTR_REMAP) { - pr_err("[INTR-REMAP] Request device [%02x:%02x.%d] fault index 0x%llx [f= ault reason 0x%02x] %s\n", + pr_err("[DMAR:%s] [INTR-REMAP] Request device [%04x:%02x:%02x.%d] fault = index 0x%llx [fault reason 0x%02x] %s\n", + iommu->name, iommu->segment, source_id >> 8, PCI_SLOT(source_id & 0xFF), PCI_FUNC(source_id & 0xFF), addr >> 48, fault_reason, reason); @@ -1903,14 +1904,18 @@ static int dmar_fault_do_one(struct intel_iommu *io= mmu, int type, } =20 if (pasid =3D=3D IOMMU_PASID_INVALID) - pr_err("[%s NO_PASID] Request device [%02x:%02x.%d] fault addr 0x%llx [f= ault reason 0x%02x] %s\n", + pr_err("[DMAR:%s] [%s NO_PASID] Request device [%04x:%02x:%02x.%d] fault= addr 0x%llx [fault reason 0x%02x] %s\n", + iommu->name, type ? "DMA Read" : "DMA Write", + iommu->segment, source_id >> 8, PCI_SLOT(source_id & 0xFF), PCI_FUNC(source_id & 0xFF), addr, fault_reason, reason); else - pr_err("[%s PASID 0x%x] Request device [%02x:%02x.%d] fault addr 0x%llx = [fault reason 0x%02x] %s\n", + pr_err("[DMAR:%s] [%s PASID 0x%x] Request device [%04x:%02x:%02x.%d] fau= lt addr 0x%llx [fault reason 0x%02x] %s\n", + iommu->name, type ? "DMA Read" : "DMA Write", pasid, + iommu->segment, source_id >> 8, PCI_SLOT(source_id & 0xFF), PCI_FUNC(source_id & 0xFF), addr, fault_reason, reason); --=20 2.43.7