Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2741396pxb; Mon, 6 Sep 2021 04:29:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYe1fFM/yS/ZCVKh8P8TUsZNqRVzYEbhP99oPPBkSbgyZ+2GcTO8j+u1Bpro9ikR8yWiq4 X-Received: by 2002:a92:c8ce:: with SMTP id c14mr4197036ilq.232.1630927789097; Mon, 06 Sep 2021 04:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630927789; cv=none; d=google.com; s=arc-20160816; b=lpx5aX1vQIx2LR/gID+v6zn/hahSHqKPdD3F7mnCCfGuz9vm5LUVRsFyoIidWz8jKU qeX1K7mMS6dWTesP5Hh8cPm9sOdELoG9Wmu3Sbol01hs0UAtY5fFn1I2LAdc6/0D7Hi2 ttG6zZvx/yiiAwyRCXlPSAZS2SQpg0q7YkkTv1MMpadFG8jReksoLrVwD52HnWGnDMvI W5kVPMQkDtBUiaqDVcuuisj/k7Xzd+meAtGWh7uzpPPQonaOXqb60cayxKYzawIP/0R4 jcyzTdxaz9bIyckLVVmUwMXN6CYM5/oGY0mqO0Z6gSIeRNSuLOLdsQcxnR3NUGv7wQoO A7BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=F1jK6ztOirGlM5N3I6WXxlk/g1dThWi/N6U8hJ/qIDQ=; b=FCgipaEA8nvRn3dAhBeD3BfCDHxFAk17JNm1lu5aAdJp8qaumx29tb/0/SJIT9Z+ZV W94rlWj1Bl5oxQuVamp4q9Nk3UEM34PQy26nepPGM1FOV9WDIJWu+YSNzBzv8Dl7sHaw teK7LSjVx25ansm/LBocdhAwg3V31vZlG9syX2DqLZQzLUnxycnPOrEDJdc+olwK8J6b S2z+7tP+QWyWLJrg3YWbGMs5/feYCMOsX2jG+EVIu+EGKD8TtRN8wz1PGKWuj7x8HhD4 53ILqG4XUREwq5tXMLHUmXYg4pucpyJKyKFYfPk9PLnpfMY5s6xdA53p396xvGcfeqld RjFg== 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 m47si6396536jaf.133.2021.09.06.04.29.37; Mon, 06 Sep 2021 04:29:49 -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 S238741AbhIFLHO (ORCPT + 99 others); Mon, 6 Sep 2021 07:07:14 -0400 Received: from foss.arm.com ([217.140.110.172]:54986 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231511AbhIFLHN (ORCPT ); Mon, 6 Sep 2021 07:07:13 -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 BF6486D; Mon, 6 Sep 2021 04:06:08 -0700 (PDT) Received: from [10.57.15.112] (unknown [10.57.15.112]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E01D03F73D; Mon, 6 Sep 2021 04:06:07 -0700 (PDT) Subject: Re: [git pull] IOMMU Updates for Linux v5.15 To: Joerg Roedel , Linus Torvalds Cc: iommu , Will Deacon , Linux Kernel Mailing List References: From: Robin Murphy Message-ID: <11f8773b-1440-a94a-220b-9f994241d0b4@arm.com> Date: Mon, 6 Sep 2021 12:06:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-09-03 22:44, Joerg Roedel wrote: > On Fri, Sep 03, 2021 at 11:43:31AM -0700, Linus Torvalds wrote: >> choice >> prompt "IOMMU default domain type" >> depends on IOMMU_API >> default IOMMU_DEFAULT_DMA_LAZY if AMD_IOMMU || INTEL_IOMMU >> default IOMMU_DEFAULT_DMA_STRICT > > Huh, yeah, that is bogus. Seems like I overlooked that part of the > patch-set because I was so amazed by the simplifications and cleanups in > the rest of it. Mad as it looks, this does in fact capture the existing behaviour. What we've consolidated here was previously a weird mix of driver- and subsystem-level controls, and it is specifically those two drivers which have a long-standing expectation of using lazy behaviour by default. >> See what I'm saying? Making the default be based on some random "this >> driver is enabled" when it can then affect *other* drivers that are >> also enabled and not part of the decision seems to be a fundamental >> confusion about what is going on, when it's not at all clear which >> driver will actually be IN USE. > > The Kconfig option itself was actually my suggestion, but how the > default value is chosen certainly needs improvement. I will sort this > out with the people involved. > >> IOW, the fix might be to just say "the default is always lazy". >> >> Or the fix might be something that is global to a configuration and >> doesn't rely on which iommu is in use (eg "on x86, the default is >> always LAZY") We could certainly express it as "default IOMMU_DEFAULT_DMA_LAZY if X86" if people would prefer - virtio-iommu doesn't support lazy mode either way, so the end result will still be equivalent. Robin. >> Or the fix is to make that 'iommu_dma_strict' variable - and the >> default value for it - be a per-IOMMU thing rather than be a global. > > My preference would be to make 'lazy' or 'strict' the default for all, > but the ARM folks might disagree. On the other side it also doesn't make > sense to let IOMMU drivers override the users Kconfig choice at runtime. > We will discuss this and come up with something better. > > Thanks, > > Joerg > _______________________________________________ > iommu mailing list > iommu@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/iommu >