]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommu/amd: Remove dead code for exclusion ranges in IVMD
authorYu Zhang <zhangyu1@linux.microsoft.com>
Tue, 31 Mar 2026 15:25:50 +0000 (23:25 +0800)
committerJoerg Roedel <joerg.roedel@amd.com>
Mon, 11 May 2026 07:36:51 +0000 (09:36 +0200)
commit45ccfdd3b577f3f0a9e86fe3f37132798dfbb2a1
tree9dde9e0e0737c71ba19a6f3df6421daab3f0bda8
parent4bf53c2d0c08bbdaa32f2114281f1ddab61902bf
iommu/amd: Remove dead code for exclusion ranges in IVMD

Exclusion ranges in IVMD are treated as unity mappings with r&w
permissions since commit 0bbe4ced53e3 ("iommu/amd: Fix the
overwritten field in IVMD header"), using 1:1 mappings. And IOMMU
Exclusion Base & Range Limit Registers (0x0020/0x0028) are actually
no longer used.

As a result, several definitions and code paths became dead code:

 - exclusion_start/exclusion_length in struct amd_iommu are never
   assigned,
 - iommu_set_exclusion_range() always returns 0 now.
 - MMIO_EXCL_ENABLE_MASK & MMIO_EXCL_ALLOW_MASK are only used by
   the removed iommu_set_exclusion_range().
 - DEV_ENTRY_EX is no longer set in any DTE.
 - IOMMU_UNITY_MAP_FLAG_EXCL_RANGE is no longer set, thus the
   IOMMU_RESV_RESERVED branch in amd_iommu_get_resv_regions() is
   no longer reachable.

Just remove all of the dead code. No functional change.

Signed-off-by: Yu Zhang <zhangyu1@linux.microsoft.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Reviewed-by: Jacob Pan <jacob.pan@linux.microsoft.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/init.c
drivers/iommu/amd/iommu.c