]> git.baikalelectronics.ru Git - kernel.git/commit
dma-iommu: Check that swiotlb is active before trying to use it
authorMario Limonciello <mario.limonciello@amd.com>
Mon, 4 Apr 2022 20:47:23 +0000 (15:47 -0500)
committerJoerg Roedel <jroedel@suse.de>
Thu, 28 Apr 2022 08:26:49 +0000 (10:26 +0200)
commitdf2fe0631e260726bf77a63332a97062064d8521
tree96020ff2404bdc73f761c2b3fa52566c8b9d954f
parentebaf29125e5f729e26fb87c60008f1257857c484
dma-iommu: Check that swiotlb is active before trying to use it

If the IOMMU is in use and an untrusted device is connected to an external
facing port but the address requested isn't page aligned will cause the
kernel to attempt to use bounce buffers.

If for some reason the bounce buffers have not been allocated this is a
problem that should be made apparent to the user.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220404204723.9767-3-mario.limonciello@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/dma-iommu.c