summaryrefslogtreecommitdiffstats
path: root/sys/x86
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-03-24 08:18:24 +0000
committerkib <kib@FreeBSD.org>2015-03-24 08:18:24 +0000
commit3fef6ad686297371c81bb2bdefe0993b030c3afd (patch)
treeaa74ceb648e7308b72b2860f1c6925394185e9e8 /sys/x86
parent487f2aaa14e3d6826efd2aa28d38382744ab9828 (diff)
downloadFreeBSD-src-3fef6ad686297371c81bb2bdefe0993b030c3afd.zip
FreeBSD-src-3fef6ad686297371c81bb2bdefe0993b030c3afd.tar.gz
MFC r280195:
When inserting new entry into the address map, ensure that not only next entry does not intersect with the tail of the new entry, but also that previous entry is also before new entry start.
Diffstat (limited to 'sys/x86')
-rw-r--r--sys/x86/iommu/intel_gas.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/x86/iommu/intel_gas.c b/sys/x86/iommu/intel_gas.c
index 51ad151..5ccf34b 100644
--- a/sys/x86/iommu/intel_gas.c
+++ b/sys/x86/iommu/intel_gas.c
@@ -366,7 +366,8 @@ dmar_gas_match_insert(struct dmar_gas_match_args *a,
next = RB_NEXT(dmar_gas_entries_tree, &a->ctx->rb_root, prev);
KASSERT(next->start >= a->entry->end &&
- next->start - a->entry->start >= a->size,
+ next->start - a->entry->start >= a->size &&
+ prev->end <= a->entry->end,
("dmar_gas_match_insert hole failed %p prev (%jx, %jx) "
"free_after %jx next (%jx, %jx) entry (%jx, %jx)", a->ctx,
(uintmax_t)prev->start, (uintmax_t)prev->end,
OpenPOWER on IntegriCloud