From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C592C07E9A for ; Wed, 14 Jul 2021 10:31:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 64AE16024A for ; Wed, 14 Jul 2021 10:31:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64AE16024A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OKXuXgXbgyXJsGfR5loZ0o0floZ9VpEm0ejLXm6USLA=; b=P0/isOn4MGZjDn/G4xMvO98Fcl Fo0Cjjp1NWJr7KWnEo2LRIOqRc4lKDXYC8jEIBdp2d6uDG9MhxHee8iCXDPkMJylrZgRJIbhrJGDP vloCgBImEQ0Q4nhL+B15yE07XDdxwtS64ThaE5OgtcitEeyei/V4s7gF+8hyb0c+D1tcvybPC6Wtu auN/ueHCf0HF3Oktu4aRA4F5N7Rf5Ixir97c6Z+2hBtsYCZwSlQJzzpyYQuksuvZlUsVSpID93/yi 5417eQ3+N8fDMKCsnr8AuYAkiJcf3B49jLuW+qhbm7SvoOgczhCi4/adpHxTf5c6f35ed72gb5QsJ BlyUMsSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3c8u-00D8nC-DQ; Wed, 14 Jul 2021 10:29:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3c8m-00D8kg-UG for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 10:29:26 +0000 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 51AFAD6E; Wed, 14 Jul 2021 03:29:19 -0700 (PDT) Received: from [10.57.36.240] (unknown [10.57.36.240]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B4FA73F774; Wed, 14 Jul 2021 03:29:14 -0700 (PDT) Subject: Re: [PATCH v2 0/3] iommu: Enable non-strict DMA on QCom SD/MMC To: Joerg Roedel Cc: Doug Anderson , Ulf Hansson , Linux Doc Mailing List , Peter Zijlstra , linux-pci@vger.kernel.org, Konrad Dybcio , Thierry Reding , Joel Fernandes , Rajat Jain , Will Deacon , Rob Clark , Saravana Kannan , Jonathan Corbet , quic_c_gdjako@quicinc.com, Linux ARM , Viresh Kumar , Veerabhadrarao Badiganti , "Paul E. McKenney" , linux-arm-msm , Bjorn Helgaas , Sonny Rao , Vlastimil Babka , Randy Dunlap , Linux MMC List , Adrian Hunter , LKML , "list@263.net:IOMMU DRIVERS" , Andrew Morton , "Maciej W. Rozycki" References: <20210624171759.4125094-1-dianders@chromium.org> From: Robin Murphy Message-ID: <255adda2-3b5f-b080-4da1-f3c5d5a4f7a6@arm.com> Date: Wed, 14 Jul 2021 11:29:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210714_032921_081459_FD3FD8DB X-CRM114-Status: GOOD ( 23.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-07-14 11:15, Joerg Roedel wrote: > Hi Robin, > > On Fri, Jul 09, 2021 at 02:56:47PM +0100, Robin Murphy wrote: >> As I mentioned before, conceptually I think this very much belongs in sysfs >> as a user decision. We essentially have 4 levels of "strictness": >> >> 1: DMA domain with bounce pages >> 2: DMA domain >> 3: DMA domain with flush queue >> 4: Identity domain > > Together with reasonable defaults (influenced by compile-time > options) it seems to be a good thing to configure at runtime via > sysfs. > > We already have CONFIG_IOMMU_DEFAULT_PASSTHROUGH, which can probably be > extended to be an option list: > > - CONFIG_IOMMU_DEFAULT_PASSTHROUGH: Trusted devices are identity > mapped > > - CONFIG_IOMMU_DEFAULT_DMA_STRICT: Trusted devices are DMA > mapped with strict flush > behavior on unmap > > - CONFIG_IOMMU_DEFAULT_DMA_LAZY: Trusted devices are DMA mapped > with flush queues for performance Indeed, I got focused on the sysfs angle, but rearranging the Kconfig default that way to match makes a lot of sense, and is another thing which should fall out really easily from my domain type rework, so I'll add that to my branch now before I forget again. > Untrusted devices always get into the DMA domain with bounce pages by > default. > > The defaults can be changed at runtime via sysfs. We already have basic > support for runtime switching of the default domain, so that can be > re-used. As mentioned yesterday, already done! I'm hoping to be able to post the patches next week after some testing :) Cheers, Robin. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel