[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b7639218-2d10-fd71-0f4b-3af3f8fa224b@arm.com>
Date: Wed, 6 Apr 2022 14:37:40 +0100
From: Robin Murphy <robin.murphy@....com>
To: Jason Gunthorpe <jgg@...dia.com>
Cc: "Tian, Kevin" <kevin.tian@...el.com>,
Lu Baolu <baolu.lu@...ux.intel.com>,
Joerg Roedel <joro@...tes.org>,
Christoph Hellwig <hch@...radead.org>,
"Raj, Ashok" <ashok.raj@...el.com>, Will Deacon <will@...nel.org>,
Jean-Philippe Brucker <jean-philippe@...aro.com>,
Eric Auger <eric.auger@...hat.com>,
"Liu, Yi L" <yi.l.liu@...el.com>,
"Pan, Jacob jun" <jacob.jun.pan@...el.com>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC v2 03/11] iommu/sva: Add iommu_domain type for SVA
On 2022-04-06 14:06, Jason Gunthorpe wrote:
> On Wed, Apr 06, 2022 at 01:32:07PM +0100, Robin Murphy wrote:
>> a particular IOMMU instance, and potentially allocate separate domains for
>> separate devices to represent the same address space, much like
>> vfio_iommu_type1_attach_group() does.
>
> I think this VFIO code also needs some more work, it currently assumes
> that if the domain ops are the same then the domains are compatible,
> and that is not true for ARM SMMU drivers.
Well, strictly it uses the ops as a "negative" heuristic that the
domains are not definitely incompatible, and only then consolidates
domains if cross-attaching actually succeeds. So I don't think it's
really so bad.
> I've been thinking of adding a domain callback 'can device attach' and
> replacing the ops compare with that instead.
Previous comment notwithstanding, much as I do tend to prefer "just try
the operation and see what happens" APIs, that might be more reliable in
the long run than trying to encode specific "sorry, you'll need to
allocate a separate domain for this device" vs. "this should have worked
but something went wrong" semantics in the return value from attach.
>> It's not really worth IOMMU drivers trying to support a domain spanning
>> potentially-heterogeneous instances internally, since they can't reasonably
>> know what matters in any particular situation.
>
> In the long run I think it will be worth optimizing. If the SMMU
> instances can share IOPTE memory then we get two wins - memory
> reduction and reduced work to read dirty bits.
>
> The dirty read in particular is very performance sensitive so if real
> work loads have many SMMUs per VM it will become a pain point.
In the ideal case though, the SVA domains are only there to logically
bridge between an existing process pagetable and IOMMU instances at the
API level, right? Surely if we're shadowing physical pagetables for SVA
we've basically already lost the performance game?
Robin.
Powered by blists - more mailing lists