From nobody Mon Jun 8 16:30:19 2026 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (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 EE3112F6565 for ; Thu, 28 May 2026 02:30:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.99 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779935404; cv=none; b=N5X2TeqmpllOvbTJXIyrrxuPejdZOSbr0QGbGQrrjAO2i8u4fc7dYbmROFUY0ZbYNQSZ1xREhL9qHSRx7kd1kpE7WpgP7gNc0uzeS2dl9o0mVP8IEG7GWIaxKKuWwvGDOvCBE8BSI7SNil7xasVit0CdVEQqVWe55IofZCfbrIA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779935404; c=relaxed/simple; bh=ygcRaXlb49jR0zxtMi9N2zyqcAIAzqJCLyn+bWo7K8s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cBoVveyDeMATL6sLkWKsOnVq/yCjb8DXfhVIFS1KHTlqu4iEczWSMyka+MWuvaE+g30smy4anzpc3OaghdHz8N/AfQrJqcPLDI5YmFgjLCXKINGvKRC3dmPUWOJb2BtmEOoB42/9F13QFqjdiDrJZM9wdFoDxHPTWknZp42CIDk= 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=xRZfKgDK; arc=none smtp.client-ip=115.124.30.99 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="xRZfKgDK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1779935394; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=Xq9xeA3g32akOr+r1BH7kHCidZV0dALaaTLolW7zqCM=; b=xRZfKgDKslTgE5CM2nlQm/YeFjwW24ef1Q4U+KNXRSl4wEce2x4dqLaq5oVE/x4NQvMmW35Q3Xr9lczzx4hYY+lk9iRkGMXTgcf2wdx/vHH9BM19gG1HtcAl8ophn716LD3UMHnmA8OeECfpCJhjtfKhVd4AjaFC+slBbHbwUMw= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;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_---0X3l1YsG_1779935383; Received: from VM20241011-104.tbsite.net(mailfrom:guanghuifeng@linux.alibaba.com fp:SMTPD_---0X3l1YsG_1779935383 cluster:ay36) by smtp.aliyun-inc.com; Thu, 28 May 2026 10:29:53 +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 v2] iommu/vt-d: improve IOMMU fault information Date: Thu, 28 May 2026 10:29:43 +0800 Message-ID: <20260528022943.1697564-1-guanghuifeng@linux.alibaba.com> X-Mailer: git-send-email 2.43.7 In-Reply-To: <4adaa6b9-6dc0-4d78-8eeb-dbe9059e76a8@linux.alibaba.com> References: <4adaa6b9-6dc0-4d78-8eeb-dbe9059e76a8@linux.alibaba.com> 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c index d33c119a935e..767ec092accd 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("[INTR-REMAP] Request device [%04x:%02x:%02x.%d] fault index 0x%l= lx [fault reason 0x%02x] %s\n", + iommu->segment, source_id >> 8, PCI_SLOT(source_id & 0xFF), PCI_FUNC(source_id & 0xFF), addr >> 48, fault_reason, reason); @@ -1903,14 +1904,16 @@ 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("[%s NO_PASID] Request device [%04x:%02x:%02x.%d] fault addr 0x%l= lx [fault reason 0x%02x] %s\n", 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("[%s PASID 0x%x] Request device [%04x:%02x:%02x.%d] fault addr 0x= %llx [fault reason 0x%02x] %s\n", 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