[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210809124931.GA1097@willie-the-truck>
Date: Mon, 9 Aug 2021 13:49:32 +0100
From: Will Deacon <will@...nel.org>
To: Robin Murphy <robin.murphy@....com>
Cc: joro@...tes.org, iommu@...ts.linux-foundation.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
suravee.suthikulpanit@....com, baolu.lu@...ux.intel.com,
john.garry@...wei.com, dianders@...omium.org, rajatja@...gle.com,
chenxiang66@...ilicon.com,
Sai Praneeth Prakhya <sai.praneeth.prakhya@...el.com>
Subject: Re: [PATCH v3 25/25] iommu: Allow enabling non-strict mode
dynamically
On Wed, Aug 04, 2021 at 06:15:53PM +0100, Robin Murphy wrote:
> Allocating and enabling a flush queue is in fact something we can
> reasonably do while a DMA domain is active, without having to rebuild it
> from scratch. Thus we can allow a strict -> non-strict transition from
> sysfs without requiring to unbind the device's driver, which is of
> particular interest to users who want to make selective relaxations to
> critical devices like the one serving their root filesystem.
>
> Disabling and draining a queue also seems technically possible to
> achieve without rebuilding the whole domain, but would certainly be more
> involved. Furthermore there's not such a clear use-case for tightening
> up security *after* the device may already have done whatever it is that
> you don't trust it not to do, so we only consider the relaxation case.
>
> CC: Sai Praneeth Prakhya <sai.praneeth.prakhya@...el.com>
> Signed-off-by: Robin Murphy <robin.murphy@....com>
>
> ---
>
> v3: Actually think about concurrency, rework most of the fq data
> accesses to be (hopefully) safe and comment it all
> ---
> drivers/iommu/dma-iommu.c | 25 ++++++++++++++++++-------
> drivers/iommu/iommu.c | 16 ++++++++++++----
> drivers/iommu/iova.c | 9 ++++++---
> 3 files changed, 36 insertions(+), 14 deletions(-)
I failed to break this, so hopefully you've caught everything now.
Only thing I wasn't sure of is why we still need the smp_wmb() in
init_iova_flush_queue(). Can we remove it now that we have one before
assigning into the cookie?
Will
Powered by blists - more mailing lists