• Eric Auger's avatar
    iommu: Revisit iommu_insert_resv_region() implementation · 4dbd258f
    Eric Auger authored
    Current implementation is recursive and in case of allocation
    failure the existing @regions list is altered. A non recursive
    version looks better for maintainability and simplifies the
    error handling. We use a separate stack for overlapping segment
    merging. The elements are sorted by start address and then by
    type, if their start address match.
    
    Note this new implementation may change the region order of
    appearance in /sys/kernel/iommu_groups/<n>/reserved_regions
    files but this order has never been documented, see
    commit bc7d12b9 ("iommu: Implement reserved_regions
    iommu-group sysfs file").
    Signed-off-by: default avatarEric Auger <eric.auger@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
    4dbd258f
iommu.c 62.7 KB