Hi Joerg,

On 2020/3/3 21:13, Joerg Roedel wrote:
Hi Baolu,

On Tue, Mar 03, 2020 at 02:47:02PM +0800, Lu Baolu wrote:
Theoretically speaking, per-device default domain is impractical. PCI
aliased devices (PCI bridge and all devices beneath it, VMD devices and
various devices quirked with pci_add_dma_alias()) must use the same
domain. It's likely that we have to introduce something like a sub-group
with all PCI aliased devices staying in it. Current private-domain
implementation in the vt-d driver was introduced for compatible purpose
and I wanted to abandon it from the first day. :-)

What hinders you from removing it now? I looked a bit closer into
these private default domain implementation and it is very fragile. If
it can be removed, then better do so sooner than later.


I will soon send out the patches for review.

Probably, we are able to configure per-group default domain type with
below two interfaces.

- (ops->)dev_def_domain_type: Return the required default domain type
   for a device. It returns
   - IOMMU_DOMAIN_DMA (device must use a DMA domain), unlikely
   - IOMMU_DOMAIN_IDENTITY (device must use an Identity domain), unlikely
   - 0 (both are okay), likely

If we stay at the group level, this interface should work on the group
level too, and not on the device level.

- iommu_group_change_def_domain: Change the default domain of a group
   Works only when all devices have no driver bond.

Btw, I have no objections about the concept of private default domains
for devices, but the implementation should be moved to generic IOMMU
code so that the behavior is consistent accross differnet IOMMU
platforms, and of course be robust.


Yes. I agree with you.


Regards,

        Joerg


Best regards,
baolu
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to