tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: bb74bc369fd2ab5f41a32c4ddc2e23bc76c3c550 commit: 40c9fc02b0564bbcbc3fc6e14f3aea3639f0afa6 [9639/9669] iommu/vt-d: Add support for detecting ACPI namespace device in RMRR config: x86_64-randconfig-161-20240520 (https://download.01.org/0day-ci/archive/20240520/202405202025.9w8wgmwQ-lkp@i...) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240520/202405202025.9w8wgmwQ-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202405202025.9w8wgmwQ-lkp@intel.com/
All errors (new ones prefixed by >>):
ld: drivers/iommu/iommu.o: in function `iommu_create_device_direct_mappings':
drivers/iommu/iommu.c:1141:(.text+0x263a): undefined reference to `iova_reserve_domain_addr'
vim +1141 drivers/iommu/iommu.c
1085 1086 static int iommu_create_device_direct_mappings(struct iommu_domain *domain, 1087 struct device *dev) 1088 { 1089 struct iommu_resv_region *entry; 1090 struct list_head mappings; 1091 unsigned long pg_size; 1092 int ret = 0; 1093 1094 pg_size = domain->pgsize_bitmap ? 1UL << __ffs(domain->pgsize_bitmap) : 0; 1095 INIT_LIST_HEAD(&mappings); 1096 1097 if (WARN_ON_ONCE(iommu_is_dma_domain(domain) && !pg_size)) 1098 return -EINVAL; 1099 1100 iommu_get_resv_regions(dev, &mappings); 1101 1102 /* We need to consider overlapping regions for different devices */ 1103 list_for_each_entry(entry, &mappings, list) { 1104 dma_addr_t start, end, addr; 1105 size_t map_size = 0; 1106 1107 if (entry->type == IOMMU_RESV_DIRECT) 1108 dev->iommu->require_direct = 1; 1109 1110 if ((entry->type != IOMMU_RESV_DIRECT && 1111 entry->type != IOMMU_RESV_DIRECT_RELAXABLE) || 1112 !iommu_is_dma_domain(domain)) 1113 continue; 1114 1115 start = ALIGN(entry->start, pg_size); 1116 end = ALIGN(entry->start + entry->length, pg_size); 1117 1118 for (addr = start; addr <= end; addr += pg_size) { 1119 phys_addr_t phys_addr; 1120 1121 if (addr == end) 1122 goto map_end; 1123 1124 phys_addr = iommu_iova_to_phys(domain, addr); 1125 if (!phys_addr) { 1126 map_size += pg_size; 1127 continue; 1128 } 1129 1130 map_end: 1131 if (map_size) { 1132 ret = iommu_map(domain, addr - map_size, 1133 addr - map_size, map_size, 1134 entry->prot, GFP_KERNEL); 1135 if (ret) 1136 goto out; 1137 map_size = 0; 1138 } 1139 } 1140 if (apply_zhaoxin_dmar_acpi_a_behavior())
1141 iova_reserve_domain_addr(domain, start, end);
1142 } 1143 1144 if (!list_empty(&mappings) && iommu_is_dma_domain(domain)) 1145 iommu_flush_iotlb_all(domain); 1146 1147 out: 1148 iommu_put_resv_regions(dev, &mappings); 1149 1150 return ret; 1151 } 1152