The branch stable/13 has been updated by dougm:

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

commit 01ebb5b8cf8f55f1cf5a994d3927411c50aac7ca
Author:     Alan Cox <[email protected]>
AuthorDate: 2022-06-26 16:48:12 +0000
Commit:     Doug Moore <[email protected]>
CommitDate: 2022-07-06 17:01:41 +0000

    iommu_gas: Fix a recent regression with IOMMU_MF_CANSPLIT
    
    As of 19bb5a7244ff, the IOMMU_MF_CANSPLIT case in iommu_gas_match_one()
    must take into account the specified offset.  Otherwise, the recently
    changed end calculation in iommu_gas_match_insert() could produce an
    end address that crosses the specified boundary by one page.
    
    Reviewed by:    dougm
    MFC with:       19bb5a7244ff
    
    (cherry picked from commit 7b39a9bc1df37502e8186593f3427b7ff0e4cc71)
---
 sys/dev/iommu/iommu_gas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c
index 23e603ef18dc..b6594af80cb9 100644
--- a/sys/dev/iommu/iommu_gas.c
+++ b/sys/dev/iommu/iommu_gas.c
@@ -350,7 +350,7 @@ iommu_gas_match_one(struct iommu_gas_match_args *a, 
iommu_gaddr_t beg,
         * the next entry, then we do not have gap.  Ignore for now.
         */
        if ((a->gas_flags & IOMMU_MF_CANSPLIT) != 0) {
-               a->size = bs - a->entry->start;
+               a->size = bs - a->entry->start - a->offset;
                return (true);
        }
 

Reply via email to