Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp496537pxb; Wed, 8 Sep 2021 06:06:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEZrI0lFn9r6ta/5xN8ZFho0c0wD5CrQXlOs4YLQpSGgHW9MMvJv5gU2dTi5RGKy1EhVvz X-Received: by 2002:a6b:5911:: with SMTP id n17mr3295883iob.180.1631106410802; Wed, 08 Sep 2021 06:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631106410; cv=none; d=google.com; s=arc-20160816; b=RQYaaWDjO1rbOgf2V8SkY+Yspnw2q3dnQ/elRHK/KRb8uwCcmodaUm4Ud4HyuRXmXd FP8iNA2QaIewt6IOCReEyNYEJYm75AHl/1wNKsRCFeAabIsqlwJSsuQ6Elv9WIz4hu9e CDVpU3775/kNn6dAlbOvZEmWGuhqcOPgANa9RP1TC2lyCyjCUEDDVbyWTmrIZVSN4Dov iHQBS/2+2TeKsF/4Lfg4ou26LuI/aVj2LDW3SYy4KEqPwNhJ7brNvmRShcbyGH/XSvFo 0ruJg9KW22Kwp4TSgi/zXzFrgyQ8No+4VAC8uUOJCmjm2p7P7oODWRJ90XR/w1fj7v78 kQPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=S2IVW3gGk28Wo7ZzLuFGr0txKFa/TCdczbSAljW1ywQ=; b=QqRufH0dBTN+QhvD196SvZ/h9Lf9nvX3Oy5WHCjrdEJ4HVEL/iySqKWVVhTiU1/bgO eSMs1r7/e14+oU4hSBFgOAQnGoZBgktHpHHav7GhDtyHrqBcch2peD7UQjamzDXoKaW5 GvgHwxZST5od9gNRdodrs6zjXAMsJNmFeXMOqJG7qjusACVBENiRRjZYzOaHN4qSTROP foi5vXeMmBxhYzJrUZg5MMzyXuYQZh6CP4mHdCckf2AtwKW5hIAfXw0wD5I7MXEhVQ8I CDA1aqtzAHoFUmd8Q5iu+nChqV6Ar0Z7E0FwkWT7tVjIuCQblXZezCaqrr3l/kvfGZ7u DKSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si2173062ilc.144.2021.09.08.06.06.38; Wed, 08 Sep 2021 06:06:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343914AbhIHM4y (ORCPT + 99 others); Wed, 8 Sep 2021 08:56:54 -0400 Received: from foss.arm.com ([217.140.110.172]:45858 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232097AbhIHM4x (ORCPT ); Wed, 8 Sep 2021 08:56:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 826C56D; Wed, 8 Sep 2021 05:55:45 -0700 (PDT) Received: from 010265703453.arm.com (unknown [10.57.15.112]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8EB2C3F766; Wed, 8 Sep 2021 05:55:44 -0700 (PDT) From: Robin Murphy To: joro@8bytes.org, will@kernel.org Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Linus Torvalds Subject: [PATCH] iommu: Clarify default domain Kconfig Date: Wed, 8 Sep 2021 13:55:37 +0100 Message-Id: <69a0c6f17b000b54b8333ee42b3124c1d5a869e2.1631105737.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Robin Murphy --- 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