Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/iommu/intel_ctx.c
Show First 20 Lines • Show All 301 Lines • ▼ Show 20 Lines | if (error1 == 0 && entry->end != entry->start) { | ||||
printf("pci%d:%d:%d ", bus, slot, func); | printf("pci%d:%d:%d ", bus, slot, func); | ||||
printf( | printf( | ||||
"dmar%d failed to map RMRR region (%jx, %jx) %d\n", | "dmar%d failed to map RMRR region (%jx, %jx) %d\n", | ||||
domain->iodom.iommu->unit, start, end, | domain->iodom.iommu->unit, start, end, | ||||
error1); | error1); | ||||
error = error1; | error = error1; | ||||
} | } | ||||
TAILQ_REMOVE(&rmrr_entries, entry, dmamap_link); | TAILQ_REMOVE(&rmrr_entries, entry, dmamap_link); | ||||
iommu_gas_free_entry(DOM2IODOM(domain), entry); | iommu_gas_free_entry(entry); | ||||
} | } | ||||
for (i = 0; i < size; i++) | for (i = 0; i < size; i++) | ||||
vm_page_putfake(ma[i]); | vm_page_putfake(ma[i]); | ||||
free(ma, M_TEMP); | free(ma, M_TEMP); | ||||
} | } | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 528 Lines • ▼ Show 20 Lines | LIST_FOREACH(domain, &dmar->domains, link) { | ||||
} | } | ||||
} | } | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
void | void | ||||
dmar_domain_free_entry(struct iommu_map_entry *entry, bool free) | dmar_domain_free_entry(struct iommu_map_entry *entry, bool free) | ||||
{ | { | ||||
struct iommu_domain *domain; | |||||
domain = entry->domain; | |||||
IOMMU_DOMAIN_LOCK(domain); | |||||
if ((entry->flags & IOMMU_MAP_ENTRY_RMRR) != 0) | if ((entry->flags & IOMMU_MAP_ENTRY_RMRR) != 0) | ||||
iommu_gas_free_region(domain, entry); | iommu_gas_free_region(entry); | ||||
else | else | ||||
iommu_gas_free_space(domain, entry); | iommu_gas_free_space(entry); | ||||
IOMMU_DOMAIN_UNLOCK(domain); | |||||
if (free) | if (free) | ||||
iommu_gas_free_entry(domain, entry); | iommu_gas_free_entry(entry); | ||||
else | else | ||||
entry->flags = 0; | entry->flags = 0; | ||||
} | } | ||||
/* | /* | ||||
* If the given value for "free" is true, then the caller must not be using | * If the given value for "free" is true, then the caller must not be using | ||||
* the entry's dmamap_link field. | * the entry's dmamap_link field. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |