Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Feb 2020 21:47:34 +0000 (UTC)
From:      Doug Moore <dougm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r357389 - head/sys/x86/iommu
Message-ID:  <202002012147.011LlYfE093675@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002012147.011LlYfE093675>