From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>,
Lu Baolu <baolu.lu@linux.intel.com>,
David Woodhouse <dwmw2@infradead.org>,
Heiko Stuebner <heiko@sntech.de>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Joerg Roedel <joro@8bytes.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-rockchip@lists.infradead.org"
<linux-rockchip@lists.infradead.org>,
"linux-sunxi@lists.linux.dev" <linux-sunxi@lists.linux.dev>,
Orson Zhai <orsonzhai@gmail.com>,
Robin Murphy <robin.murphy@arm.com>,
Samuel Holland <samuel@sholland.org>,
Chen-Yu Tsai <wens@csie.org>, Will Deacon <will@kernel.org>,
Chunyan Zhang <zhang.lyra@gmail.com>,
Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH 07/10] iommu/ipmmu-vmsa: Convert to generic_single_device_group()
Date: Fri, 21 Jul 2023 09:04:07 -0300 [thread overview]
Message-ID: <ZLp0NwPJBCTHh7dX@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB52761FF5AA9D8A24C30A12CA8C3FA@BN9PR11MB5276.namprd11.prod.outlook.com>
On Fri, Jul 21, 2023 at 07:20:21AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Wednesday, July 19, 2023 3:06 AM
> >
> > -static struct iommu_group *ipmmu_find_group(struct device *dev)
> > -{
> > - struct ipmmu_vmsa_device *mmu = to_ipmmu(dev);
> > - struct iommu_group *group;
> > -
> > - if (mmu->group)
> > - return iommu_group_ref_get(mmu->group);
> > -
> > - group = iommu_group_alloc();
> > - if (!IS_ERR(group))
> > - mmu->group = group;
> > -
> > - return group;
> > -}
>
> Looks existing code has a leak w/o freeing the group in ipmmu_remove().
IIRC many of the drivers had this, or other bugs here.
> While at it could you add a patch to fix it allowing backport and then this
> patch to convert to the generic helper?
It isn't worth it, these drivers are never removed, so it is a bug
that nobody will ever hit.
Jason
WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>,
Lu Baolu <baolu.lu@linux.intel.com>,
David Woodhouse <dwmw2@infradead.org>,
Heiko Stuebner <heiko@sntech.de>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Joerg Roedel <joro@8bytes.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-rockchip@lists.infradead.org"
<linux-rockchip@lists.infradead.org>,
"linux-sunxi@lists.linux.dev" <linux-sunxi@lists.linux.dev>,
Orson Zhai <orsonzhai@gmail.com>,
Robin Murphy <robin.murphy@arm.com>,
Samuel Holland <samuel@sholland.org>,
Chen-Yu Tsai <wens@csie.org>, Will Deacon <will@kernel.org>,
Chunyan Zhang <zhang.lyra@gmail.com>,
Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH 07/10] iommu/ipmmu-vmsa: Convert to generic_single_device_group()
Date: Fri, 21 Jul 2023 09:04:07 -0300 [thread overview]
Message-ID: <ZLp0NwPJBCTHh7dX@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB52761FF5AA9D8A24C30A12CA8C3FA@BN9PR11MB5276.namprd11.prod.outlook.com>
On Fri, Jul 21, 2023 at 07:20:21AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Wednesday, July 19, 2023 3:06 AM
> >
> > -static struct iommu_group *ipmmu_find_group(struct device *dev)
> > -{
> > - struct ipmmu_vmsa_device *mmu = to_ipmmu(dev);
> > - struct iommu_group *group;
> > -
> > - if (mmu->group)
> > - return iommu_group_ref_get(mmu->group);
> > -
> > - group = iommu_group_alloc();
> > - if (!IS_ERR(group))
> > - mmu->group = group;
> > -
> > - return group;
> > -}
>
> Looks existing code has a leak w/o freeing the group in ipmmu_remove().
IIRC many of the drivers had this, or other bugs here.
> While at it could you add a patch to fix it allowing backport and then this
> patch to convert to the generic helper?
It isn't worth it, these drivers are never removed, so it is a bug
that nobody will ever hit.
Jason
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>,
Lu Baolu <baolu.lu@linux.intel.com>,
David Woodhouse <dwmw2@infradead.org>,
Heiko Stuebner <heiko@sntech.de>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Joerg Roedel <joro@8bytes.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-rockchip@lists.infradead.org"
<linux-rockchip@lists.infradead.org>,
"linux-sunxi@lists.linux.dev" <linux-sunxi@lists.linux.dev>,
Orson Zhai <orsonzhai@gmail.com>,
Robin Murphy <robin.murphy@arm.com>,
Samuel Holland <samuel@sholland.org>,
Chen-Yu Tsai <wens@csie.org>, Will Deacon <will@kernel.org>,
Chunyan Zhang <zhang.lyra@gmail.com>,
Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH 07/10] iommu/ipmmu-vmsa: Convert to generic_single_device_group()
Date: Fri, 21 Jul 2023 09:04:07 -0300 [thread overview]
Message-ID: <ZLp0NwPJBCTHh7dX@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB52761FF5AA9D8A24C30A12CA8C3FA@BN9PR11MB5276.namprd11.prod.outlook.com>
On Fri, Jul 21, 2023 at 07:20:21AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Wednesday, July 19, 2023 3:06 AM
> >
> > -static struct iommu_group *ipmmu_find_group(struct device *dev)
> > -{
> > - struct ipmmu_vmsa_device *mmu = to_ipmmu(dev);
> > - struct iommu_group *group;
> > -
> > - if (mmu->group)
> > - return iommu_group_ref_get(mmu->group);
> > -
> > - group = iommu_group_alloc();
> > - if (!IS_ERR(group))
> > - mmu->group = group;
> > -
> > - return group;
> > -}
>
> Looks existing code has a leak w/o freeing the group in ipmmu_remove().
IIRC many of the drivers had this, or other bugs here.
> While at it could you add a patch to fix it allowing backport and then this
> patch to convert to the generic helper?
It isn't worth it, these drivers are never removed, so it is a bug
that nobody will ever hit.
Jason
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-21 12:04 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-18 19:05 [PATCH 00/10] Refine the locking for dev->iommu_group Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` [PATCH 01/10] iommu: Remove useless group refcounting Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-20 6:11 ` Baolu Lu
2023-07-20 6:11 ` Baolu Lu
2023-07-20 6:11 ` Baolu Lu
2023-07-21 7:10 ` Tian, Kevin
2023-07-21 7:10 ` Tian, Kevin
2023-07-21 7:10 ` Tian, Kevin
2023-07-21 12:01 ` Jason Gunthorpe
2023-07-21 12:01 ` Jason Gunthorpe
2023-07-21 12:01 ` Jason Gunthorpe
2023-07-24 2:11 ` Tian, Kevin
2023-07-24 2:11 ` Tian, Kevin
2023-07-24 18:06 ` Jason Gunthorpe
2023-07-24 18:06 ` Jason Gunthorpe
2023-07-25 2:12 ` Tian, Kevin
2023-07-25 2:12 ` Tian, Kevin
2023-07-18 19:05 ` [PATCH 02/10] iommu: Add a lockdep assertion for remaining dev->iommu_group reads Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-20 6:33 ` Baolu Lu
2023-07-20 6:33 ` Baolu Lu
2023-07-20 6:33 ` Baolu Lu
2023-07-18 19:05 ` [PATCH 03/10] iommu: Add generic_single_device_group() Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-20 7:39 ` Baolu Lu
2023-07-20 7:39 ` Baolu Lu
2023-07-20 7:39 ` Baolu Lu
2023-07-20 12:04 ` Jason Gunthorpe
2023-07-20 12:04 ` Jason Gunthorpe
2023-07-20 12:04 ` Jason Gunthorpe
2023-07-20 14:01 ` Baolu Lu
2023-07-20 14:01 ` Baolu Lu
2023-07-20 14:01 ` Baolu Lu
2023-07-21 17:19 ` Jason Gunthorpe
2023-07-21 17:19 ` Jason Gunthorpe
2023-07-21 17:19 ` Jason Gunthorpe
2023-07-22 14:01 ` Baolu Lu
2023-07-22 14:01 ` Baolu Lu
2023-07-22 14:01 ` Baolu Lu
2023-07-21 7:17 ` Tian, Kevin
2023-07-21 7:17 ` Tian, Kevin
2023-07-21 7:17 ` Tian, Kevin
2023-07-24 13:15 ` Jason Gunthorpe
2023-07-24 13:15 ` Jason Gunthorpe
2023-07-22 14:02 ` Baolu Lu
2023-07-22 14:02 ` Baolu Lu
2023-07-22 14:02 ` Baolu Lu
2023-07-18 19:05 ` [PATCH 04/10] iommu/sun50i: Convert to generic_single_device_group() Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` [PATCH 05/10] iommu/sprd: " Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` [PATCH 06/10] iommu/rockchip: " Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` [PATCH 07/10] iommu/ipmmu-vmsa: " Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-21 7:20 ` Tian, Kevin
2023-07-21 7:20 ` Tian, Kevin
2023-07-21 7:20 ` Tian, Kevin
2023-07-21 12:04 ` Jason Gunthorpe [this message]
2023-07-21 12:04 ` Jason Gunthorpe
2023-07-21 12:04 ` Jason Gunthorpe
2023-07-18 19:05 ` [PATCH 08/10] iommu/omap: " Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` [PATCH 09/10] iommu: Complete the locking for dev->iommu_group Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-20 9:55 ` Baolu Lu
2023-07-20 9:55 ` Baolu Lu
2023-07-20 9:55 ` Baolu Lu
2023-07-18 19:05 ` [PATCH 10/10] iommu/intel: Fix missing locking for show_device_domain_translation() Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-18 19:05 ` Jason Gunthorpe
2023-07-20 9:56 ` Baolu Lu
2023-07-20 9:56 ` Baolu Lu
2023-07-20 9:56 ` Baolu Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZLp0NwPJBCTHh7dX@nvidia.com \
--to=jgg@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=baolu.lu@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=heiko@sntech.de \
--cc=iommu@lists.linux.dev \
--cc=jernej.skrabec@gmail.com \
--cc=joro@8bytes.org \
--cc=kevin.tian@intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=orsonzhai@gmail.com \
--cc=robin.murphy@arm.com \
--cc=samuel@sholland.org \
--cc=wens@csie.org \
--cc=will@kernel.org \
--cc=zhang.lyra@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.