Commit 1a2b3357 authored by David Rientjes's avatar David Rientjes Committed by Christoph Hellwig

dma-direct: add missing set_memory_decrypted() for coherent mapping

When a coherent mapping is created in dma_direct_alloc_pages(), it needs
to be decrypted if the device requires unencrypted DMA before returning.

Fixes: 3acac065 ("dma-mapping: merge the generic remapping helpers into dma-direct")
Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 56fccf21
......@@ -195,6 +195,12 @@ void *dma_direct_alloc_pages(struct device *dev, size_t size,
__builtin_return_address(0));
if (!ret)
goto out_free_pages;
if (force_dma_unencrypted(dev)) {
err = set_memory_decrypted((unsigned long)ret,
1 << get_order(size));
if (err)
goto out_free_pages;
}
memset(ret, 0, size);
goto done;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment