Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Apr 2025 00:54:36 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b01d15abbae5 - stable/14 - iommu_gas_map_region(): add comment explaining the ma array shift
Message-ID:  <202504040054.5340sacU037570@gitrepo.freebsd.org>

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

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

commit b01d15abbae5767d1a3fae6afe56475c988447a3
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-01-25 09:37:50 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-04-04 00:54:06 +0000

    iommu_gas_map_region(): add comment explaining the ma array shift
    
    (cherry picked from commit 45f70f98fc55b753b1e7a7374b4a061aa1f27392)
---
 sys/dev/iommu/iommu_gas.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c
index d97bdee47b28..ffa8dc096adc 100644
--- a/sys/dev/iommu/iommu_gas.c
+++ b/sys/dev/iommu/iommu_gas.c
@@ -875,6 +875,11 @@ iommu_gas_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry,
 	if (entry->end == entry->start)
 		return (0);
 
+	/*
+	 * iommu_gas_alloc_region() might clipped the entry start and
+	 * end positions.  Adjust the beginning of the ma array to map
+	 * the pages at the requested relative positions.
+	 */
 	error = domain->ops->map(domain, entry,
 	    ma + OFF_TO_IDX(start - entry->start), eflags,
 	    ((flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0));



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