On Wed, Oct 18, 2023 at 09:27:02PM +0100, Joao Martins wrote: > Throughout IOMMU domain lifetime that wants to use dirty tracking, some > guarantees are needed such that any device attached to the iommu_domain > supports dirty tracking. > > The idea is to handle a case where IOMMU in the system are assymetric > feature-wise and thus the capability may not be supported for all devices. > The enforcement is done by adding a flag into HWPT_ALLOC namely: > > IOMMUFD_HWPT_ALLOC_ENFORCE_DIRTY > > .. Passed in HWPT_ALLOC ioctl() flags. The enforcement is done by creating > a iommu_domain via domain_alloc_user() and validating the requested flags > with what the device IOMMU supports (and failing accordingly) advertised). > Advertising the new IOMMU domain feature flag requires that the individual > iommu driver capability is supported when a future device attachment > happens. > > Link: https://lore.kernel.org/kvm/20220721142421.GB4609@xxxxxxxxxx/ > Signed-off-by: Joao Martins <joao.m.martins@xxxxxxxxxx> > --- > drivers/iommu/iommufd/hw_pagetable.c | 4 +++- > include/uapi/linux/iommufd.h | 3 +++ > 2 files changed, 6 insertions(+), 1 deletion(-) Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx> Jason