svn commit: r357389 - head/sys/x86/iommu

Doug Moore dougm at FreeBSD.org
Sat Feb 1 21:47:34 UTC 2020


Author: dougm
Date: Sat Feb  1 21:47:34 2020
New Revision: 357389
URL: https://svnweb.freebsd.org/changeset/base/357389

Log:
  In dmar_gas_lowermatch, skip searching a subtree if all its addresses are greater than lowaddr.
  In dmar_gas_uppermatch, skip searching a subtree if all its gaps-between-alloctions are too small.
  
  Reviewed by:	kib
  Tested by:	pho
  Differential Revision:	https://reviews.freebsd.org/D23391

Modified:
  head/sys/x86/iommu/intel_gas.c

Modified: head/sys/x86/iommu/intel_gas.c
==============================================================================
--- head/sys/x86/iommu/intel_gas.c	Sat Feb  1 21:43:45 2020	(r357388)
+++ head/sys/x86/iommu/intel_gas.c	Sat Feb  1 21:47:34 2020	(r357389)
@@ -370,6 +370,8 @@ dmar_gas_lowermatch(struct dmar_gas_match_args *a, str
 	}
 	if (entry->free_down < a->size + a->offset + DMAR_PAGE_SIZE)
 		return (ENOMEM);
+	if (entry->first >= a->common->lowaddr)
+		return (ENOMEM);
 	child = RB_LEFT(entry, rb_entry);
 	if (child != NULL && 0 == dmar_gas_lowermatch(a, child))
 		return (0);
@@ -390,6 +392,8 @@ dmar_gas_uppermatch(struct dmar_gas_match_args *a, str
 {
 	struct dmar_map_entry *child;
 
+	if (entry->free_down < a->size + a->offset + DMAR_PAGE_SIZE)
+		return (ENOMEM);
 	if (entry->last < a->common->highaddr)
 		return (ENOMEM);
 	child = RB_LEFT(entry, rb_entry);


More information about the svn-src-all mailing list