[PATCH v2] iommu/arm-smmu: Break insecure users by disabling bypass by default

2019-03-01 Thread Douglas Anderson
. Suggested-by: Robin Murphy Signed-off-by: Douglas Anderson --- Changes in v2: - Flipped default to 'yes' and changed comments a lot. drivers/iommu/Kconfig| 25 + drivers/iommu/arm-smmu.c | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH] iommu/arm-smmu: Allow disabling bypass via kernel config

2019-02-14 Thread Douglas Anderson
the existing ability to adjust the configuration via kernel command line. Signed-off-by: Douglas Anderson --- drivers/iommu/Kconfig| 22 ++ drivers/iommu/arm-smmu.c | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu

[PATCH] iommu: Properly pass gfp_t in _iommu_map() to avoid atomic sleeping

2021-02-01 Thread Douglas Anderson
Move iotlb_sync_map out from __iommu_map") Signed-off-by: Douglas Anderson --- I haven't done any serious testing on this. I saw a report of the warning and the fix seemed obvious so I'm shooting it out. drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dri

[PATCH 0/6] iommu: Enable devices to request non-strict DMA, starting with QCom SD/MMC

2021-06-21 Thread Douglas Anderson
ds up being landable, it will undoubtedly need coordination between many maintainers to land. I believe it's fully bisectable but later patches in the series definitely depend on earlier ones. Sorry for the long CC list. :( Douglas Anderson (6): drivers: base: Add the concept of "pre_pr

[PATCH 1/6] drivers: base: Add the concept of "pre_probe" to drivers

2021-06-21 Thread Douglas Anderson
ot;struct platform_device *" that most platform devices get passed to their probe). Presumably this won't cause trouble and it's a lot less code to write but if we need to make it more symmetric that's also possible by touching more files. Signed-off-by: Douglas Anderson --- drivers/base/dd.c

[PATCH 2/6] drivers: base: Add bits to struct device to control iommu strictness

2021-06-21 Thread Douglas Anderson
fields can be filled in by the bus code like in the patch ("PCI: Indicate that we want to force strict DMA for untrusted devices") or by using the new pre_probe concept introduced in the patch ("drivers: base: Add the concept of "pre_probe" to drivers"). Signed-off-by:

[PATCH 3/6] PCI: Indicate that we want to force strict DMA for untrusted devices

2021-06-21 Thread Douglas Anderson
dd more booleans into the "struct device") so we can fully eliminate the need for the IOMMU framework to reach into a PCIe device. Signed-off-by: Douglas Anderson --- drivers/pci/probe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/probe.c b/dr

[PATCH 4/6] iommu: Combine device strictness requests with the global default

2021-06-21 Thread Douglas Anderson
mdline "iommu.strict=1" or a call to iommu_set_dma_strict(true). Signed-off-by: Douglas Anderson --- drivers/iommu/iommu.c | 56 +-- include/linux/iommu.h | 2 ++ 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/drivers/iommu/i

[PATCH 5/6] iommu: Stop reaching into PCIe devices to decide strict vs. non-strict

2021-06-21 Thread Douglas Anderson
nly handles removing the one related to iommu.strict. Removing the other cases is left as an exercise to the reader. Signed-off-by: Douglas Anderson --- drivers/iommu/dma-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iom

[PATCH 6/6] mmc: sdhci-msm: Request non-strict IOMMU mode

2021-06-21 Thread Douglas Anderson
nice advantage of using the pre_probe() to set this. [1] https://lore.kernel.org/r/20210618040639.3113489-1-j...@joelfernandes.org [2] https://lore.kernel.org/r/1623850736-389584-1-git-send-email-quic_c_gdj...@quicinc.com/ [3] https://lore.kernel.org/r/cover.1623981933.git.saiprakash.ran..

[PATCH v2 2/3] iommu/arm-smmu: Check for strictness after calling impl->init_context()

2021-06-24 Thread Douglas Anderson
Implementations should be able to affect the strictness so reorder a little bit so we call them before we look at the strictness. Signed-off-by: Douglas Anderson --- Changes in v2: - Patch moving check for strictness in arm-smmu new for v2. drivers/iommu/arm/arm-smmu/arm-smmu.c | 6 +++--- 1

[PATCH v2 3/3] mmc: sdhci-msm: Request non-strict IOMMU mode

2021-06-24 Thread Douglas Anderson
ernel.org/r/20210618040639.3113489-1-j...@joelfernandes.org [2] https://lore.kernel.org/r/1623850736-389584-1-git-send-email-quic_c_gdj...@quicinc.com/ [3] https://lore.kernel.org/r/cover.1623981933.git.saiprakash.ran...@codeaurora.org/ [4] https://lore.kernel.org/r/20210621235248.2521620-1-di

[PATCH v2 0/3] iommu: Enable non-strict DMA on QCom SD/MMC

2021-06-24 Thread Douglas Anderson
y things pointed out by Greg. Douglas Anderson (3): iommu: Add per-domain strictness and combine with the global default iommu/arm-smmu: Check for strictness after calling impl->init_context() mmc: sdhci-msm: Request non-strict IOMMU mode .../admin-guide/kernel-parameters.txt | 5

[PATCH v2 1/3] iommu: Add per-domain strictness and combine with the global default

2021-06-24 Thread Douglas Anderson
ine "iommu.strict=1" or a call to iommu_set_dma_strict(true). [0] https://lore.kernel.org/r/a023af85-5060-0a3c-4648-b00f8b8c0...@arm.com/ Signed-off-by: Douglas Anderson --- This patch clearly will cause conflicts if John Garry's patches [1] land before it. It shouldn't be too hard to