Assign the reserved apic region (GAS entry) to the iommu domain msi_entry.

Requested by:	kib
Reviewed by:	kib
Sponsored by:	Innovate DSbD
Differential Revision:	https://reviews.freebsd.org/D26859
This commit is contained in:
br 2020-10-19 15:50:58 +00:00
parent 2ea649d973
commit 4fe53bb02d
3 changed files with 5 additions and 3 deletions

View File

@ -197,7 +197,7 @@ void iommu_gas_free_region(struct iommu_domain *domain,
int iommu_gas_map_region(struct iommu_domain *domain,
struct iommu_map_entry *entry, u_int eflags, u_int flags, vm_page_t *ma);
int iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start,
iommu_gaddr_t end);
iommu_gaddr_t end, struct iommu_map_entry **entry0);
void iommu_set_buswide_ctx(struct iommu_unit *unit, u_int busno);
bool iommu_is_buswide_ctx(struct iommu_unit *unit, u_int busno);

View File

@ -677,7 +677,7 @@ iommu_gas_map_region(struct iommu_domain *domain, struct iommu_map_entry *entry,
int
iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start,
iommu_gaddr_t end)
iommu_gaddr_t end, struct iommu_map_entry **entry0)
{
struct iommu_map_entry *entry;
int error;
@ -692,6 +692,8 @@ iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start,
IOMMU_DOMAIN_UNLOCK(domain);
if (error != 0)
iommu_gas_free_entry(domain, entry);
else if (entry0 != NULL)
*entry0 = entry;
return (error);
}

View File

@ -366,7 +366,7 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapped)
goto fail;
/* Disable local apic region access */
error = iommu_gas_reserve_region(iodom, 0xfee00000,
0xfeefffff + 1);
0xfeefffff + 1, &iodom->msi_entry);
if (error != 0)
goto fail;
}