]> git.baikalelectronics.ru Git - kernel.git/commit
iommu: Allow enabling non-strict mode dynamically
authorRobin Murphy <robin.murphy@arm.com>
Wed, 11 Aug 2021 12:21:38 +0000 (13:21 +0100)
committerJoerg Roedel <jroedel@suse.de>
Wed, 18 Aug 2021 11:27:49 +0000 (13:27 +0200)
commite9ab7993e36a3c9fbd3d689f1b5b9da7efe6b02d
treeba5049ab1aab6991887ab1b1b8baf141f8509e14
parent09a0cd2c25e7d3f8ea73e647fcbefa7746894fcd
iommu: Allow enabling non-strict mode dynamically

Allocating and enabling a flush queue is in fact something we can
reasonably do while a DMA domain is active, without having to rebuild it
from scratch. Thus we can allow a strict -> non-strict transition from
sysfs without requiring to unbind the device's driver, which is of
particular interest to users who want to make selective relaxations to
critical devices like the one serving their root filesystem.

Disabling and draining a queue also seems technically possible to
achieve without rebuilding the whole domain, but would certainly be more
involved. Furthermore there's not such a clear use-case for tightening
up security *after* the device may already have done whatever it is that
you don't trust it not to do, so we only consider the relaxation case.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/d652966348c78457c38bf18daf369272a4ebc2c9.1628682049.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/dma-iommu.c
drivers/iommu/iommu.c
drivers/iommu/iova.c
include/linux/dma-iommu.h