diff options
| author | Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org> | 2026-09-08 17:02:32 +0530 |
|---|---|---|
| committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2026-09-11 10:30:50 +0200 |
| commit | 55a8e1451869233db837a97e8f3cbf9983bc8678 (patch) | |
| tree | f58b02a879c1ed9119b84f3875d31e94e84f83ab /scripts/Makefile.thinlto | |
| parent | 92c6a8d6470f7e7aa86c1f144818d8fa4fcbd5aa (diff) | |
| download | linux-stable-55a8e1451869233db837a97e8f3cbf9983bc8678.tar.gz linux-stable-55a8e1451869233db837a97e8f3cbf9983bc8678.zip | |
x86/mm: Don't force unencrypted DMA for IOMMU-backed devices
Commit 8277a12d0d60 ("dma-pool: track decrypted atomic pools and select
them via attrs") exposed an issue with force_dma_unencrypted() on
systems using host memory encryption.
force_dma_unencrypted() checks whether the device DMA mask can address
the encryption bit and, if not, requires DMA allocations to use
unencrypted memory. However, this check is not applicable when the
device is using the IOMMU. In that case, the device DMA mask constrains
the IOVA seen by the device, not the backing physical address, so it
does not need to cover the C-bit.
This currently causes dma_alloc_attrs() to set
__DMA_ATTR_ALLOC_CC_SHARED for such devices. iommu_dma_alloc() does not
support that attribute and rejects the allocation, causing DMA
allocations to fail.
Do not force DMA allocations to be unencrypted when the device is using
the IOMMU. This allows the IOMMU to map the encrypted physical pages as
before and avoids incorrectly requesting CC_SHARED allocations.
Fixes: 8277a12d0d60 ("dma-pool: track decrypted atomic pools and select them via attrs")
Reported-by: Timo Witte <timo.witte@gmail.com>
Closes: https://lore.kernel.org/all/CANB4YXS=Nf-co3t8eMHtqrW4sn=1BDcP6o=EoTrgZm0WYMYTyw@mail.gmail.com/
Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
Link: https://lore.kernel.org/r/20260908113232.247457-1-aneesh.kumar@kernel.org
[mszyprow: adjusted url and changed 'link' tag to the 'closes' one]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
