From a3d78402d2af44d52128eb63adc526c93beec9cb Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 24 Mar 2015 12:46:21 +0000 Subject: [PATCH] Assert that the mapping loop makes progress. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/iommu/intel_idpgtbl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c index e2cce1af45e..6621b172021 100644 --- a/sys/x86/iommu/intel_idpgtbl.c +++ b/sys/x86/iommu/intel_idpgtbl.c @@ -465,6 +465,7 @@ ctx_map_buf_locked(struct dmar_ctx *ctx, dmar_gaddr_t base, dmar_gaddr_t size, KASSERT(size >= pg_sz, ("mapping loop overflow %p %jx %jx %jx", ctx, (uintmax_t)base, (uintmax_t)size, (uintmax_t)pg_sz)); + KASSERT(pg_sz > 0, ("pg_sz 0 lvl %d", lvl)); pte = ctx_pgtbl_map_pte(ctx, base, lvl, flags, &idx, &sf); if (pte == NULL) { KASSERT((flags & DMAR_PGF_WAITOK) == 0,