[PATCH v10 14/18] iommufd/viommu: Identify physical IOMMU backing with a tag
Tian, Kevin
kevin.tian at intel.com
Thu Dec 3 18:49:22 PST 2026
> From: Jason Gunthorpe <jgg at ziepe.ca>
> Sent: Thursday, December 3, 2026 11:54 PM
>
> On Thu, Dec 03, 2026 at 06:42:51AM +0000, Tian, Kevin wrote:
>
> > this patch and next intend to put that constraint only on the legacy usage,
> > probably based on the observation that there is only one tsm in a platform
> > so one tsm viommu can support all kinds of devices behind different
> physical
> > IOMMUs.
>
> That won't be true for ARM or AMD. Any viommu that has a direct
> bypass command queue to the guest must have viommu 1:1 with piommu.
>
> For these tsm cases the viommu driver should be selecting if it is
> compatible
>
> And maybe that is the proper generalization, make all the drivers work
> that way and the physical drivers simple always require 1:1
yes, that way we keep the current semantics. No need of various backing
tags as done here.
>
> > We have two options here. One is to inherit the current uapi definition
> > for tsm then abandon this patch. otherwise to not break the existing uapi
> > we'd better introduce a new viommu_alloc flag to explicitly mark the
> > viommu as CC type which then can be defined with a different semantics
> > from legacy.
>
> Not sure I see the uAPI issue? The VMM basically needs to know the
> rules for the viommu it selected when it selects it. If it is a 1:1
> with physical or not is baked into the selection, I Think, or should
> be returned by one of the driver's GET_INFOs ?
>
the 1:1 restriction is written in current uAPI description, while this patch
seems to violate it for tsm viommu in iommufd core.
I'd opt for inheriting the 1:1 restriction for all tsm viommus. It's simpler.
More information about the linux-arm-kernel
mailing list