Lines Matching refs:dmaru
295 struct dmar_drhd_unit *dmaru;
298 for_each_drhd_unit(dmaru) {
299 if (dmaru->include_all)
302 drhd = container_of(dmaru->hdr,
306 dmaru->segment,
307 dmaru->devices, dmaru->devices_cnt);
324 struct dmar_drhd_unit *dmaru;
326 for_each_drhd_unit(dmaru)
327 if (dmar_remove_dev_scope(info, dmaru->segment,
328 dmaru->devices, dmaru->devices_cnt))
391 struct dmar_drhd_unit *dmaru;
393 list_for_each_entry_rcu(dmaru, &dmar_drhd_units, list,
395 if (dmaru->segment == drhd->segment &&
396 dmaru->reg_base_addr == drhd->address)
397 return dmaru;
410 struct dmar_drhd_unit *dmaru;
414 dmaru = dmar_find_dmaru(drhd);
415 if (dmaru)
418 dmaru = kzalloc(sizeof(*dmaru) + header->length, GFP_KERNEL);
419 if (!dmaru)
426 dmaru->hdr = (void *)(dmaru + 1);
427 memcpy(dmaru->hdr, header, header->length);
428 dmaru->reg_base_addr = drhd->address;
429 dmaru->segment = drhd->segment;
431 dmaru->reg_size = 1UL << (drhd->size + 12);
432 dmaru->include_all = drhd->flags & 0x1; /* BIT0: INCLUDE_ALL */
433 dmaru->devices = dmar_alloc_dev_scope((void *)(drhd + 1),
435 &dmaru->devices_cnt);
436 if (dmaru->devices_cnt && dmaru->devices == NULL) {
437 kfree(dmaru);
441 ret = alloc_iommu(dmaru);
443 dmar_free_dev_scope(&dmaru->devices,
444 &dmaru->devices_cnt);
445 kfree(dmaru);
448 dmar_register_drhd_unit(dmaru);
457 static void dmar_free_drhd(struct dmar_drhd_unit *dmaru)
459 if (dmaru->devices && dmaru->devices_cnt)
460 dmar_free_dev_scope(&dmaru->devices, &dmaru->devices_cnt);
461 if (dmaru->iommu)
462 free_iommu(dmaru->iommu);
463 kfree(dmaru);
701 struct dmar_drhd_unit *dmaru;
707 for_each_drhd_unit(dmaru) {
708 drhd = container_of(dmaru->hdr,
712 if (dmaru->include_all &&
716 if (dmar_pci_device_match(dmaru->devices,
717 dmaru->devices_cnt, dev))
720 dmaru = NULL;
724 return dmaru;
730 struct dmar_drhd_unit *dmaru;
737 for_each_drhd_unit(dmaru) {
738 drhd = container_of(dmaru->hdr,
752 dev_name(&adev->dev), dmaru->reg_base_addr,
754 for_each_dev_scope(dmaru->devices, dmaru->devices_cnt, i, tmp)
756 dmaru->devices[i].bus = scope->bus;
757 dmaru->devices[i].devfn = PCI_DEVFN(path->device,
759 rcu_assign_pointer(dmaru->devices[i].dev,
763 BUG_ON(i >= dmaru->devices_cnt);
2175 struct dmar_drhd_unit *dmaru, *dmaru_n;
2184 list_for_each_entry_safe(dmaru, dmaru_n, &dmar_drhd_units, list) {
2185 list_del(&dmaru->list);
2186 dmar_free_drhd(dmaru);
2256 struct dmar_drhd_unit *dmaru;
2258 dmaru = dmar_find_dmaru((struct acpi_dmar_hardware_unit *)header);
2259 if (!dmaru)
2262 ret = dmar_ir_hotplug(dmaru, true);
2264 ret = dmar_iommu_hotplug(dmaru, true);
2273 struct dmar_drhd_unit *dmaru;
2275 dmaru = dmar_find_dmaru((struct acpi_dmar_hardware_unit *)header);
2276 if (!dmaru)
2282 if (!dmaru->include_all && dmaru->devices && dmaru->devices_cnt) {
2283 for_each_active_dev_scope(dmaru->devices,
2284 dmaru->devices_cnt, i, dev)
2288 ret = dmar_ir_hotplug(dmaru, false);
2290 ret = dmar_iommu_hotplug(dmaru, false);
2297 struct dmar_drhd_unit *dmaru;
2299 dmaru = dmar_find_dmaru((struct acpi_dmar_hardware_unit *)header);
2300 if (dmaru) {
2301 list_del_rcu(&dmaru->list);
2303 dmar_free_drhd(dmaru);