Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Nov 2022 08:25:40 GMT
From:      Doug Moore <dougm@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 7a5de4db8cf1 - stable/13 - iommu_gas: drop fini cleanup loop
Message-ID:  <202211210825.2AL8PenD015651@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dougm:

URL: https://cgit.FreeBSD.org/src/commit/?id=7a5de4db8cf1862673f18b8b3b3d524c3847e51e

commit 7a5de4db8cf1862673f18b8b3b3d524c3847e51e
Author:     Doug Moore <dougm@FreeBSD.org>
AuthorDate: 2022-10-29 17:56:06 +0000
Commit:     Doug Moore <dougm@FreeBSD.org>
CommitDate: 2022-11-21 08:25:12 +0000

    iommu_gas: drop fini cleanup loop
    
    Assertions suggest that the loop in iommu_gas_fini_domain is executed
    zero times, so remove it.
    
    Reviewed by:    alc, kib
    MFC after:      3 weeks
    Differential Revision:  https://reviews.freebsd.org/D37204
    
    (cherry picked from commit a2c57c60d9e2667744357fdadd79a98ce64d3ad9)
---
 sys/dev/iommu/iommu_gas.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c
index ffb5370b507e..5654bc7ed8de 100644
--- a/sys/dev/iommu/iommu_gas.c
+++ b/sys/dev/iommu/iommu_gas.c
@@ -274,7 +274,7 @@ iommu_gas_init_domain(struct iommu_domain *domain)
 void
 iommu_gas_fini_domain(struct iommu_domain *domain)
 {
-	struct iommu_map_entry *entry, *entry1;
+	struct iommu_map_entry *entry;
 
 	IOMMU_DOMAIN_ASSERT_LOCKED(domain);
 	KASSERT(domain->entries_cnt == 2,
@@ -297,14 +297,6 @@ iommu_gas_fini_domain(struct iommu_domain *domain)
 	    ("end entry flags %p", domain));
 	iommu_gas_rb_remove(domain, entry);
 	iommu_gas_free_entry(entry);
-
-	RB_FOREACH_SAFE(entry, iommu_gas_entries_tree, &domain->rb_root,
-	    entry1) {
-		KASSERT((entry->flags & IOMMU_MAP_ENTRY_RMRR) != 0,
-		    ("non-RMRR entry left %p", domain));
-		iommu_gas_rb_remove(domain, entry);
-		iommu_gas_free_entry(entry);
-	}
 }
 
 struct iommu_gas_match_args {
@@ -409,9 +401,9 @@ iommu_gas_next(struct iommu_map_entry *curr, iommu_gaddr_t min_free)
 /*
  * Address-ordered first-fit search of 'domain' for free space satisfying the
  * conditions of 'a'.  The space allocated is at least one page big, and is
- * bounded by guard pages to left and right.  The allocated space for 'domain'
- * is described by an rb-tree of map entries at domain->rb_root, and
- * domain->start_gap points a map entry less than or adjacent to the first
+ * bounded by guard pages to the left and right.  The allocated space for
+ * 'domain' is described by an rb-tree of map entries at domain->rb_root, and
+ * domain->start_gap points to a map entry less than or adjacent to the first
  * free-space of size at least 3 pages.
  */
 static int



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