Use the BUS_DMA_NOWRITE flag to expose and create the read-only VT-d

IOMMU mappings.

Reviewed by:	kib
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D19729
This commit is contained in:
tychon 2019-03-27 20:15:51 +00:00
parent 562ca52ecd
commit b637576aff

View File

@ -527,7 +527,8 @@ dmar_bus_dmamap_load_something1(struct bus_dma_tag_dmar *tag,
gas_flags |= DMAR_GM_CANSPLIT; gas_flags |= DMAR_GM_CANSPLIT;
error = dmar_gas_map(domain, &tag->common, size, offset, error = dmar_gas_map(domain, &tag->common, size, offset,
DMAR_MAP_ENTRY_READ | DMAR_MAP_ENTRY_WRITE, DMAR_MAP_ENTRY_READ |
((flags & BUS_DMA_NOWRITE) == 0 ? DMAR_MAP_ENTRY_WRITE : 0),
gas_flags, ma + idx, &entry); gas_flags, ma + idx, &entry);
if (error != 0) if (error != 0)
break; break;