2021-09-08 13:06:50

by Robin Murphy

[permalink] [raw]
Subject: [PATCH] iommu: Clarify default domain Kconfig

Although strictly it is the AMD and Intel drivers which have an existing
expectation of lazy behaviour by default, it ends up being rather
unintuitive to describe this literally in Kconfig. Express it instead as
an architecture dependency, to clarify that it is a valid config-time
decision. The end result is the same since virtio-iommu doesn't support
lazy mode and thus falls back to strict at runtime regardless.

The per-architecture disparity is a matter of historical expectations:
the AMD and Intel drivers have been lazy by default since 2008, and
changing that gets noticed by people asking where their I/O throughput
has gone. Conversely, Arm-based systems with their wider assortment of
IOMMU drivers mostly only support strict mode anyway; only the Arm SMMU
drivers have later grown support for passthrough and lazy mode, for
users who wanted to explicitly trade off isolation for performance.
These days, reducing the default level of isolation in a way which may
go unnoticed by users who expect otherwise hardly seems worth risking
for the sake of one line of Kconfig, so here's where we are.

Reported-by: Linus Torvalds <[email protected]>
Signed-off-by: Robin Murphy <[email protected]>
---
drivers/iommu/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 8ad8618b3530..124c41adeca1 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -82,7 +82,7 @@ config IOMMU_DEBUGFS
choice
prompt "IOMMU default domain type"
depends on IOMMU_API
- default IOMMU_DEFAULT_DMA_LAZY if AMD_IOMMU || INTEL_IOMMU
+ default IOMMU_DEFAULT_DMA_LAZY if X86 || IA64
default IOMMU_DEFAULT_DMA_STRICT
help
Choose the type of IOMMU domain used to manage DMA API usage by
--
2.25.1


2021-09-08 17:48:46

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] iommu: Clarify default domain Kconfig

On Wed, Sep 8, 2021 at 5:55 AM Robin Murphy <[email protected]> wrote:
>
> Although strictly it is the AMD and Intel drivers which have an existing
> expectation of lazy behaviour by default, it ends up being rather
> unintuitive to describe this literally in Kconfig. Express it instead as
> an architecture dependency, to clarify that it is a valid config-time
> decision.

Thanks, I think this describes the behavior much more naturally, even
if apparently the end result is pretty much identical.

I'm assuming I'll get it through the iommu tree eventually (no need to
expedite this),

Linus

2021-09-09 09:51:12

by Joerg Roedel

[permalink] [raw]
Subject: Re: [PATCH] iommu: Clarify default domain Kconfig

On Wed, Sep 08, 2021 at 09:47:03AM -0700, Linus Torvalds wrote:
> I'm assuming I'll get it through the iommu tree eventually (no need to
> expedite this)

Yes, I just applied it along with a couple of other fixes to the iommu
tree and will send a pull-request tomorrow.

Thanks,

Joerg