RE: [PATCH 1/2] iommu: Add static iommu_ops->release_domain

From: Tian, Kevin
Date: Tue Feb 27 2024 - 22:08:25 EST


> From: Baolu Lu <baolu.lu@xxxxxxxxxxxxxxx>
> Sent: Wednesday, February 28, 2024 9:14 AM
>
> On 2/27/24 3:32 PM, Tian, Kevin wrote:
> >> From: Lu Baolu<baolu.lu@xxxxxxxxxxxxxxx>
> >> Sent: Friday, February 23, 2024 1:13 PM
> >>
> >>
> >> + /*
> >> + * If the iommu driver provides release_domain then the core code
> >> + * ensures that domain is attached prior to calling release_device.
> >> + * Drivers can use this to enforce a translation on the idle iommu.
> > 'enforce a translation' is confusing in the context of blocking/identity
> > domain.
>
> Blocking or identity domain is also kind of a translation from the
> core's perspective. The core does not care what type of translation the
> release_domain is; it just enforces this type of translation before
> device release if the driver has specified one.
>

OK.

btw you may also want to update the following comment together:

/*
* release_device() must stop using any attached domain on the device.
* If there are still other devices in the group they are not effected
* by this callback.
*
* The IOMMU driver must set the device to either an identity or
* blocking translation and stop using any domain pointer, as it is
* going to be freed.
*/

all the purpose is to set the device to identity or blocking, either via attaching
to an explicit release_domain or implicitly by release_device().