When mapping an allocated entry, use the entry size, instead of the

requested size.  If tag restrictions caused split entry, its size is
less then requsted.

Hardware provided by:	Michael Fuckner <michael@fuckner.net>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
kib 2015-03-24 12:48:51 +00:00
parent 2c4be9847f
commit db27434eb5

View File

@ -649,7 +649,7 @@ dmar_gas_map(struct dmar_ctx *ctx, const struct bus_dma_tag_common *common,
entry->flags |= eflags;
DMAR_CTX_UNLOCK(ctx);
error = ctx_map_buf(ctx, entry->start, size, ma,
error = ctx_map_buf(ctx, entry->start, entry->end - entry->start, ma,
((eflags & DMAR_MAP_ENTRY_READ) != 0 ? DMAR_PTE_R : 0) |
((eflags & DMAR_MAP_ENTRY_WRITE) != 0 ? DMAR_PTE_W : 0) |
((eflags & DMAR_MAP_ENTRY_SNOOP) != 0 ? DMAR_PTE_SNP : 0) |