[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191127144006.25998-3-hch@lst.de>
Date: Wed, 27 Nov 2019 15:40:06 +0100
From: Christoph Hellwig <hch@....de>
To: Thomas Hellstrom <thellstrom@...are.com>
Cc: Christian König <christian.koenig@....com>,
Tom Lendacky <thomas.lendacky@....com>,
iommu@...ts.linux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] dma-mapping: force unencryped devices are always addressing limited
Devices that are forced to DMA through unencrypted bounce buffers
need to be treated as if they are addressing limited.
Signed-off-by: Christoph Hellwig <hch@....de>
---
kernel/dma/mapping.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
index 1dbe6d725962..f6c35b53d996 100644
--- a/kernel/dma/mapping.c
+++ b/kernel/dma/mapping.c
@@ -416,6 +416,8 @@ EXPORT_SYMBOL_GPL(dma_get_merge_boundary);
*/
bool dma_addressing_limited(struct device *dev)
{
+ if (force_dma_unencrypted(dev))
+ return true;
return min_not_zero(dma_get_mask(dev), dev->bus_dma_limit) <
dma_get_required_mask(dev);
}
--
2.20.1
Powered by blists - more mailing lists