lkml.org 
[lkml]   [2022]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 4/5] vfio/iommu_type1: Clean up update_dirty_scope in detach_group()
On Wed, Jun 08, 2022 at 08:35:47AM +0000, Tian, Kevin wrote:

> > @@ -2519,7 +2515,17 @@ static void vfio_iommu_type1_detach_group(void
> > *iommu_data,
> > kfree(domain);
> > vfio_iommu_aper_expand(iommu, &iova_copy);
> > vfio_update_pgsize_bitmap(iommu);
> > + /*
> > + * Removal of a group without dirty tracking may
> > allow
> > + * the iommu scope to be promoted.
> > + */
> > + if (!group->pinned_page_dirty_scope) {
> > + iommu->num_non_pinned_groups--;
> > + if (iommu->dirty_page_tracking)
> > +
> > vfio_iommu_populate_bitmap_full(iommu);
>
> This doesn't look correct. The old code decrements
> num_non_pinned_groups for every detach group without dirty
> tracking. But now it's only done when the domain is about to
> be released...

Hmm..you are right. It should be placed outside:
if (list_empty(&domain->group_list)) {
...
}
+ if (!group->pinned_page_dirty_scope) {
+ ...
+ }

Will fix this and the same problem in PATCH-5 too.

Thanks!

\
 
 \ /
  Last update: 2022-06-08 19:47    [W:0.094 / U:19.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site