[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YqDgdqVIEwWF1Lku@Asurada-Nvidia>
Date: Wed, 8 Jun 2022 10:46:30 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: "Tian, Kevin" <kevin.tian@...el.com>
CC: "jgg@...dia.com" <jgg@...dia.com>,
"joro@...tes.org" <joro@...tes.org>,
"will@...nel.org" <will@...nel.org>,
"marcan@...can.st" <marcan@...can.st>,
"sven@...npeter.dev" <sven@...npeter.dev>,
"robin.murphy@....com" <robin.murphy@....com>,
"robdclark@...il.com" <robdclark@...il.com>,
"m.szyprowski@...sung.com" <m.szyprowski@...sung.com>,
"krzysztof.kozlowski@...aro.org" <krzysztof.kozlowski@...aro.org>,
"baolu.lu@...ux.intel.com" <baolu.lu@...ux.intel.com>,
"agross@...nel.org" <agross@...nel.org>,
"bjorn.andersson@...aro.org" <bjorn.andersson@...aro.org>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"heiko@...ech.de" <heiko@...ech.de>,
"orsonzhai@...il.com" <orsonzhai@...il.com>,
"baolin.wang7@...il.com" <baolin.wang7@...il.com>,
"zhang.lyra@...il.com" <zhang.lyra@...il.com>,
"wens@...e.org" <wens@...e.org>,
"jernej.skrabec@...il.com" <jernej.skrabec@...il.com>,
"samuel@...lland.org" <samuel@...lland.org>,
"jean-philippe@...aro.org" <jean-philippe@...aro.org>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"thierry.reding@...il.com" <thierry.reding@...il.com>,
"alim.akhtar@...sung.com" <alim.akhtar@...sung.com>,
"alyssa@...enzweig.io" <alyssa@...enzweig.io>,
"linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
"linux-samsung-soc@...r.kernel.org"
<linux-samsung-soc@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"jonathanh@...dia.com" <jonathanh@...dia.com>,
"linux-rockchip@...ts.infradead.org"
<linux-rockchip@...ts.infradead.org>,
"gerald.schaefer@...ux.ibm.com" <gerald.schaefer@...ux.ibm.com>,
"linux-sunxi@...ts.linux.dev" <linux-sunxi@...ts.linux.dev>,
"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
"linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"cohuck@...hat.com" <cohuck@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
"dwmw2@...radead.org" <dwmw2@...radead.org>
Subject: Re: [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!
Powered by blists - more mailing lists