]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iommu/vt-d: Improve IOMMU fault information
authorGuanghui Feng <guanghuifeng@linux.alibaba.com>
Thu, 4 Jun 2026 06:03:09 +0000 (14:03 +0800)
committerJoerg Roedel <joerg.roedel@amd.com>
Thu, 4 Jun 2026 07:21:50 +0000 (09:21 +0200)
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 <guanghuifeng@linux.alibaba.com>
Link: https://lore.kernel.org/r/20260528022943.1697564-1-guanghuifeng@linux.alibaba.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/intel/dmar.c

index d33c119a935ec41ad2bdd3050b28c092c3034fca..767ec092accd7530df90b0c05808f724fe47250c 100644 (file)
@@ -1894,7 +1894,8 @@ static int dmar_fault_do_one(struct intel_iommu *iommu, int type,
        reason = dmar_get_fault_reason(fault_reason, &fault_type);
 
        if (fault_type == INTR_REMAP) {
-               pr_err("[INTR-REMAP] Request device [%02x:%02x.%d] fault index 0x%llx [fault reason 0x%02x] %s\n",
+               pr_err("[INTR-REMAP] Request device [%04x:%02x:%02x.%d] fault index 0x%llx [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 *iommu, int type,
        }
 
        if (pasid == IOMMU_PASID_INVALID)
-               pr_err("[%s NO_PASID] Request device [%02x:%02x.%d] fault addr 0x%llx [fault reason 0x%02x] %s\n",
+               pr_err("[%s NO_PASID] Request device [%04x:%02x:%02x.%d] fault addr 0x%llx [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);