Skip to content

Commit 4a627a2

Browse files
TinaZhangZWjoergroedel
authored andcommitted
iommu/vt-d: Remove BUG_ON in handling iotlb cache invalidation
VT-d iotlb cache invalidation request with unexpected type is considered as a bug to developers, which can be fixed. So, when such kind of issue comes out, it needs to be reported through the kernel log, instead of halting the system. Replacing BUG_ON with warning reporting. Signed-off-by: Tina Zhang <tina.zhang@intel.com> Link: https://lore.kernel.org/r/20230406065944.2773296-4-tina.zhang@intel.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 35dc5d8 commit 4a627a2

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

drivers/iommu/intel/iommu.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,9 @@ static void __iommu_flush_context(struct intel_iommu *iommu,
12721272
| DMA_CCMD_SID(source_id) | DMA_CCMD_FM(function_mask);
12731273
break;
12741274
default:
1275-
BUG();
1275+
pr_warn("%s: Unexpected context-cache invalidation type 0x%llx\n",
1276+
iommu->name, type);
1277+
return;
12761278
}
12771279
val |= DMA_CCMD_ICC;
12781280

@@ -1308,7 +1310,9 @@ static void __iommu_flush_iotlb(struct intel_iommu *iommu, u16 did,
13081310
val_iva = size_order | addr;
13091311
break;
13101312
default:
1311-
BUG();
1313+
pr_warn("%s: Unexpected iotlb invalidation type 0x%llx\n",
1314+
iommu->name, type);
1315+
return;
13121316
}
13131317
/* Note: set drain read/write */
13141318
#if 0
@@ -1483,7 +1487,8 @@ static void iommu_flush_iotlb_psi(struct intel_iommu *iommu,
14831487
uint64_t addr = (uint64_t)pfn << VTD_PAGE_SHIFT;
14841488
u16 did = domain_id_iommu(domain, iommu);
14851489

1486-
BUG_ON(pages == 0);
1490+
if (WARN_ON(!pages))
1491+
return;
14871492

14881493
if (ih)
14891494
ih = 1 << 6;

0 commit comments

Comments
 (0)