Re: [PATCH v2] iommufd/device: Enforce reserved IOVA also when attached to hwpt_nested
From: Nicolin Chen
Date: Tue Aug 06 2024 - 12:51:14 EST
On Tue, Aug 06, 2024 at 08:08:49AM +0000, Tian, Kevin wrote:
> > From: Nicolin Chen <nicolinc@xxxxxxxxxx>
> > Sent: Tuesday, August 6, 2024 1:02 PM
> >
> > +iommufd_group_do_replace_reserved_iova(struct iommufd_group *igroup,
> > + struct iommufd_hw_pagetable *hwpt)
> > {
> > - struct iommufd_hw_pagetable *old_hwpt = igroup->hwpt;
> > + struct iommufd_hwpt_paging *hwpt_paging =
> > to_hwpt_paging(hwpt);
> > struct iommufd_device *cur;
> > int rc;
> >
> > lockdep_assert_held(&igroup->lock);
> >
> > - if (!hwpt_is_paging(old_hwpt) ||
> > - hwpt_paging->ioas != to_hwpt_paging(old_hwpt)->ioas) {
> > + if (!hwpt_paging)
> > + return 0;
> > +
> > + if (hwpt_to_ioas(hwpt) &&
>
> this check is always true when hwpt_paging is valid.
>
> Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
I can drop it.
Thanks
Nicolin