> From: Joao Martins <joao.m.martins@xxxxxxxxxx> > Sent: Thursday, October 19, 2023 4:27 AM > > + > + if (!IS_ERR(domain) && enforce_dirty) { > + if (to_dmar_domain(domain)->use_first_level) { > + iommu_domain_free(domain); > + return ERR_PTR(-EOPNOTSUPP); > + } > + domain->dirty_ops = &intel_dirty_ops; > + } I don't understand why we should check use_first_level here. It's a dead condition as alloc_user() only uses 2nd level. Later when nested is introduced then we explicitly disallow enforce_dirty on a nested user domain. otherwise with Baolu's comments addressed: Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>