dma/direct: Handle force decryption for DMA coherent buffers in common code
authorChristoph Hellwig <hch@lst.de>
Mon, 19 Mar 2018 10:38:25 +0000 (11:38 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 20 Mar 2018 09:01:59 +0000 (10:01 +0100)
commitc10f07aa27dadf5ab5b3d58c48c91a467f80db49
treed5cae52525387ecf0de4a2ad043d2b433307b2b4
parentb6e05477c10c12e36141558fc14f04b00ea634d4
dma/direct: Handle force decryption for DMA coherent buffers in common code

With that in place the generic DMA-direct routines can be used to
allocate non-encrypted bounce buffers, and the x86 SEV case can use
the generic swiotlb ops including nice features such as using CMA
allocations.

Note that I'm not too happy about using sev_active() in DMA-direct, but
I couldn't come up with a good enough name for a wrapper to make it
worth adding.

Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Jon Mason <jdmason@kudzu.us>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Muli Ben-Yehuda <mulix@mulix.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: iommu@lists.linux-foundation.org
Link: http://lkml.kernel.org/r/20180319103826.12853-14-hch@lst.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/mm/mem_encrypt.c
lib/dma-direct.c