[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <255adda2-3b5f-b080-4da1-f3c5d5a4f7a6@arm.com>
Date: Wed, 14 Jul 2021 11:29:08 +0100
From: Robin Murphy <robin.murphy@....com>
To: Joerg Roedel <joro@...tes.org>
Cc: Doug Anderson <dianders@...omium.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
linux-pci@...r.kernel.org,
Konrad Dybcio <konrad.dybcio@...ainline.org>,
Thierry Reding <thierry.reding@...il.com>,
Joel Fernandes <joel@...lfernandes.org>,
Rajat Jain <rajatja@...gle.com>, Will Deacon <will@...nel.org>,
Rob Clark <robdclark@...omium.org>,
Saravana Kannan <saravanak@...gle.com>,
Jonathan Corbet <corbet@....net>, quic_c_gdjako@...cinc.com,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Viresh Kumar <viresh.kumar@...aro.org>,
Veerabhadrarao Badiganti <vbadigan@...eaurora.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Sonny Rao <sonnyrao@...omium.org>,
Vlastimil Babka <vbabka@...e.cz>,
Randy Dunlap <rdunlap@...radead.org>,
Linux MMC List <linux-mmc@...r.kernel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
LKML <linux-kernel@...r.kernel.org>,
"list@....net:IOMMU DRIVERS" <iommu@...ts.linux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"Maciej W. Rozycki" <macro@...am.me.uk>
Subject: Re: [PATCH v2 0/3] iommu: Enable non-strict DMA on QCom SD/MMC
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.
Powered by blists - more mailing lists