Lines Matching refs:dmaru
298 struct dmar_drhd_unit *dmaru;
301 for_each_drhd_unit(dmaru) {
302 if (dmaru->include_all)
305 drhd = container_of(dmaru->hdr,
309 dmaru->segment,
310 dmaru->devices, dmaru->devices_cnt);
327 struct dmar_drhd_unit *dmaru;
329 for_each_drhd_unit(dmaru)
330 if (dmar_remove_dev_scope(info, dmaru->segment,
331 dmaru->devices, dmaru->devices_cnt))
394 struct dmar_drhd_unit *dmaru;
396 list_for_each_entry_rcu(dmaru, &dmar_drhd_units, list,
398 if (dmaru->segment == drhd->segment &&
399 dmaru->reg_base_addr == drhd->address)
400 return dmaru;
413 struct dmar_drhd_unit *dmaru;
417 dmaru = dmar_find_dmaru(drhd);
418 if (dmaru)
421 dmaru = kzalloc(sizeof(*dmaru) + header->length, GFP_KERNEL);
422 if (!dmaru)
429 dmaru->hdr = (void *)(dmaru + 1);
430 memcpy(dmaru->hdr, header, header->length);
431 dmaru->reg_base_addr = drhd->address;
432 dmaru->segment = drhd->segment;
433 dmaru->include_all = drhd->flags & 0x1; /* BIT0: INCLUDE_ALL */
434 dmaru->devices = dmar_alloc_dev_scope((void *)(drhd + 1),
436 &dmaru->devices_cnt);
437 if (dmaru->devices_cnt && dmaru->devices == NULL) {
438 kfree(dmaru);
442 ret = alloc_iommu(dmaru);
444 dmar_free_dev_scope(&dmaru->devices,
445 &dmaru->devices_cnt);
446 kfree(dmaru);
449 dmar_register_drhd_unit(dmaru);
458 static void dmar_free_drhd(struct dmar_drhd_unit *dmaru)
460 if (dmaru->devices && dmaru->devices_cnt)
461 dmar_free_dev_scope(&dmaru->devices, &dmaru->devices_cnt);
462 if (dmaru->iommu)
463 free_iommu(dmaru->iommu);
464 kfree(dmaru);
696 struct dmar_drhd_unit *dmaru;
702 for_each_drhd_unit(dmaru) {
703 drhd = container_of(dmaru->hdr,
707 if (dmaru->include_all &&
711 if (dmar_pci_device_match(dmaru->devices,
712 dmaru->devices_cnt, dev))
715 dmaru = NULL;
719 return dmaru;
725 struct dmar_drhd_unit *dmaru;
732 for_each_drhd_unit(dmaru) {
733 drhd = container_of(dmaru->hdr,
747 dev_name(&adev->dev), dmaru->reg_base_addr,
749 for_each_dev_scope(dmaru->devices, dmaru->devices_cnt, i, tmp)
751 dmaru->devices[i].bus = scope->bus;
752 dmaru->devices[i].devfn = PCI_DEVFN(path->device,
754 rcu_assign_pointer(dmaru->devices[i].dev,
758 BUG_ON(i >= dmaru->devices_cnt);
2041 struct dmar_drhd_unit *dmaru, *dmaru_n;
2050 list_for_each_entry_safe(dmaru, dmaru_n, &dmar_drhd_units, list) {
2051 list_del(&dmaru->list);
2052 dmar_free_drhd(dmaru);
2121 struct dmar_drhd_unit *dmaru;
2123 dmaru = dmar_find_dmaru((struct acpi_dmar_hardware_unit *)header);
2124 if (!dmaru)
2127 ret = dmar_ir_hotplug(dmaru, true);
2129 ret = dmar_iommu_hotplug(dmaru, true);
2138 struct dmar_drhd_unit *dmaru;
2140 dmaru = dmar_find_dmaru((struct acpi_dmar_hardware_unit *)header);
2141 if (!dmaru)
2147 if (!dmaru->include_all && dmaru->devices && dmaru->devices_cnt) {
2148 for_each_active_dev_scope(dmaru->devices,
2149 dmaru->devices_cnt, i, dev)
2153 ret = dmar_ir_hotplug(dmaru, false);
2155 ret = dmar_iommu_hotplug(dmaru, false);
2162 struct dmar_drhd_unit *dmaru;
2164 dmaru = dmar_find_dmaru((struct acpi_dmar_hardware_unit *)header);
2165 if (dmaru) {
2166 list_del_rcu(&dmaru->list);
2168 dmar_free_drhd(dmaru);