> From: Liu, Yi L <yi.l.liu@xxxxxxxxx> > Sent: Tuesday, October 24, 2023 11:06 PM > + > +static int iommufd_group_do_replace_paging(struct iommufd_group > *igroup, > + struct iommufd_hw_pagetable > *hwpt) > +{ > + struct iommufd_hw_pagetable *old_hwpt = igroup->hwpt; > + struct iommufd_device *cur; > + int rc; > + > + lockdep_assert_held(&igroup->lock); > + > + if (hwpt_is_paging(old_hwpt) && hwpt->ioas != old_hwpt->ioas) { > + list_for_each_entry(cur, &igroup->device_list, group_item) { > + rc = iopt_table_enforce_dev_resv_regions( > + &hwpt->ioas->iopt, cur->dev, NULL); > + if (rc) > + goto err_unresv; > + } should be: if (!hwpt_is_paging(old_hwpt) || hwpt->ioas != old_hwpt->ioas) { ...