[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation
From: |
Joao Martins |
Subject: |
Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation |
Date: |
Tue, 16 Jul 2024 10:47:21 +0100 |
On 16/07/2024 10:39, Cédric Le Goater wrote:
> On 7/12/24 13:46, Joao Martins wrote:
>> There's generally two modes of operation for IOMMUFD:
>>
>> * The simple user API which intends to perform relatively simple things
>> with IOMMUs e.g. DPDK. It generally creates an IOAS and attach to VFIO
>> and mainly performs IOAS_MAP and UNMAP.
>>
>> * The native IOMMUFD API where you have fine grained control of the
>> IOMMU domain and model it accordingly. This is where most new feature
>> are being steered to.
>>
>> For dirty tracking 2)
>
> I suppose 1) and 2) are the bullets above ?
>
yeah
>> is required, as it needs to ensure that
>> the stage-2/parent IOMMU domain will only attach devices
>> that support dirty tracking (so far it is all homogeneous in x86, likely
>> not the case for smmuv3). Such invariant on dirty tracking provides a
>> useful guarantee to VMMs that will refuse incompatible device
>> attachments for IOMMU domains.
>>
>> Dirty tracking insurance is enforced via HWPT_ALLOC, which is
>> responsible for creating an IOMMU domain. This is contrast to the
>> 'simple API' where the IOMMU domain is created by IOMMUFD automatically
>> when it attaches to VFIO (usually referred as autodomains) but it has
>> the needed handling for mdevs.
>>
>> To support dirty tracking with the advanced IOMMUFD API, it needs
>> similar logic, where IOMMU domains are created and devices attached to
>> compatible domains. Essentially mimmicing kernel
>
> mimmicing -> mimicking, I think.
>
Ack
>> iommufd_device_auto_get_domain(). With mdevs given there's no IOMMU domain
>> it falls back to IOAS attach.
>>
>> The auto domain logic allows different IOMMU domains to be created when
>> DMA dirty tracking is not desired (and VF can provide it), and others where
>> it is. Here is not used in this way here given how VFIODevice migration
>> state is initialized after the device attachment. But such mixed mode of
>> IOMMU dirty tracking + device dirty tracking is an improvement that can
>> be added on. Keep the 'all of nothing' of type1 approach that we have
>> been using so far between container vs device dirty tracking.
>>
>> Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
>
> Reviewed-by: Cédric Le Goater <clg@redhat.com>
>
> This needs feedback from IOMMUFD experts also.
I take it that by IOMMUFD experts you the ones more familiar with Qemu side
(Zhenzhong and/or Yi)
Joao
- [PATCH v4 10/12] vfio/iommufd: Implement VFIOIOMMUClass::query_dirty_bitmap support, (continued)
- [PATCH v4 10/12] vfio/iommufd: Implement VFIOIOMMUClass::query_dirty_bitmap support, Joao Martins, 2024/07/12
- [PATCH v4 04/12] vfio/iommufd: Return errno in iommufd_cdev_attach_ioas_hwpt(), Joao Martins, 2024/07/12
- [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Joao Martins, 2024/07/12
- Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Cédric Le Goater, 2024/07/16
- Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation,
Joao Martins <=
- Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Cédric Le Goater, 2024/07/16
- Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Eric Auger, 2024/07/16
- Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Joao Martins, 2024/07/16
- Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Joao Martins, 2024/07/16
- RE: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Duan, Zhenzhong, 2024/07/16
- Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Joao Martins, 2024/07/17
- Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Cédric Le Goater, 2024/07/17
- Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Joao Martins, 2024/07/17
- Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Joao Martins, 2024/07/18
- Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation, Cédric Le Goater, 2024/07/19