]> git.baikalelectronics.ru Git - kernel.git/commit
dma-mapping: move pgprot_decrypted out of dma_pgprot
authorChristoph Hellwig <hch@lst.de>
Thu, 31 Mar 2022 06:01:21 +0000 (08:01 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 1 Apr 2022 04:46:51 +0000 (06:46 +0200)
commitd715fb24e167c3271287c5e309995f7e0fd19bc8
tree25a20702eebea21692e61ed758b287f2efa4267d
parentafc12adcf70068fe9e076b3da5752cddccbb5bde
dma-mapping: move pgprot_decrypted out of dma_pgprot

pgprot_decrypted is used by AMD SME systems to allow access to memory
that was set to not encrypted using set_memory_decrypted.  That only
happens for dma-direct memory as the IOMMU solves the addressing
challenges for the encryption bit using its own remapping.

Move the pgprot_decrypted call out of dma_pgprot which is also used
by the IOMMU mappings and into dma-direct so that it is only used with
memory that was set decrypted.

Fixes: 2831b8a1cc52 ("dma-mapping: remove CONFIG_DMA_REMAP")
Reported-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
kernel/dma/direct.c
kernel/dma/mapping.c