* RE: [PATCH v7 4/5] iommu: Support mm PASID 1:n with sva domains
[not found] ` <20231012134310.GI55194@ziepe.ca>
@ 2023-10-13 9:57 ` Zhang, Tina
2023-10-14 0:03 ` Jason Gunthorpe
0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Tina @ 2023-10-13 9:57 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Tian, Kevin, Lu Baolu, Michael Shavit, Vasant Hegde, Nicolin Chen,
linux-kernel@vger.kernel.org, iommu@lists.linux.dev
Hi,
> -----Original Message-----
> From: Jason Gunthorpe <jgg@ziepe.ca>
> Sent: Thursday, October 12, 2023 9:43 PM
> To: Zhang, Tina <tina.zhang@intel.com>
> Cc: Tian, Kevin <kevin.tian@intel.com>; Lu Baolu <baolu.lu@linux.intel.com>;
> Michael Shavit <mshavit@google.com>; Vasant Hegde
> <vasant.hegde@amd.com>; Nicolin Chen ^C-cc=iommu @ lists . linux . dev
> <nicolinc@nvidia.com>; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v7 4/5] iommu: Support mm PASID 1:n with sva domains
>
> On Thu, Oct 12, 2023 at 11:01:11AM +0800, Tina Zhang wrote:
>
> > @@ -1188,15 +1193,26 @@ static inline bool
> > tegra_dev_iommu_get_stream_id(struct device *dev, u32 *stream #ifdef
> > CONFIG_IOMMU_SVA static inline void mm_pasid_init(struct mm_struct
> > *mm) {
> > - mm->pasid = IOMMU_PASID_INVALID;
> > + /*
> > + * During dup_mm(), a new mm will be memcpy'd from an old one
> and that makes
> > + * the new mm and the old one point to a same iommu_mm
> instance. When either
> > + * one of the two mms gets released, the iommu_mm instance is
> freed, leaving
> > + * the other mm running into a use-after-free/double-free problem.
> To avoid
> > + * the problem, zeroing the iommu_mm pointer of a new mm is
> needed here.
> > + */
> > + mm->iommu_mm = NULL;
> > }
>
> newlines after all the }, between functions doesn't checkpatch complain?
Checked with checkpatch but didn't see any complaining.
>
> IMHO this hunk should be moved to the prior patch.
In this patch, we switch to use mm->iommu_mm. That's why the iommu_mm initialization is put in this patch.
I think I met some problem about my mailbox when I was sending this new version. It didn't cc iommu@lists.linux.dev. Should I resend this version again or reply to the patches with iommu@lists.linux.dev cc'd?
Regards,
-Tina
>
> But it all looks good to me now
>
> Thanks,
> Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v7 4/5] iommu: Support mm PASID 1:n with sva domains
2023-10-13 9:57 ` [PATCH v7 4/5] iommu: Support mm PASID 1:n with sva domains Zhang, Tina
@ 2023-10-14 0:03 ` Jason Gunthorpe
2023-10-14 1:02 ` Nicolin Chen
0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2023-10-14 0:03 UTC (permalink / raw)
To: Zhang, Tina
Cc: Tian, Kevin, Lu Baolu, Michael Shavit, Vasant Hegde, Nicolin Chen,
linux-kernel@vger.kernel.org, iommu@lists.linux.dev
On Fri, Oct 13, 2023 at 09:57:30AM +0000, Zhang, Tina wrote:
> Hi,
>
> > -----Original Message-----
> > From: Jason Gunthorpe <jgg@ziepe.ca>
> > Sent: Thursday, October 12, 2023 9:43 PM
> > To: Zhang, Tina <tina.zhang@intel.com>
> > Cc: Tian, Kevin <kevin.tian@intel.com>; Lu Baolu <baolu.lu@linux.intel.com>;
> > Michael Shavit <mshavit@google.com>; Vasant Hegde
> > <vasant.hegde@amd.com>; Nicolin Chen ^C-cc=iommu @ lists . linux . dev
> > <nicolinc@nvidia.com>; linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH v7 4/5] iommu: Support mm PASID 1:n with sva domains
> >
> > On Thu, Oct 12, 2023 at 11:01:11AM +0800, Tina Zhang wrote:
> >
> > > @@ -1188,15 +1193,26 @@ static inline bool
> > > tegra_dev_iommu_get_stream_id(struct device *dev, u32 *stream #ifdef
> > > CONFIG_IOMMU_SVA static inline void mm_pasid_init(struct mm_struct
> > > *mm) {
> > > - mm->pasid = IOMMU_PASID_INVALID;
> > > + /*
> > > + * During dup_mm(), a new mm will be memcpy'd from an old one
> > and that makes
> > > + * the new mm and the old one point to a same iommu_mm
> > instance. When either
> > > + * one of the two mms gets released, the iommu_mm instance is
> > freed, leaving
> > > + * the other mm running into a use-after-free/double-free problem.
> > To avoid
> > > + * the problem, zeroing the iommu_mm pointer of a new mm is
> > needed here.
> > > + */
> > > + mm->iommu_mm = NULL;
> > > }
> >
> > newlines after all the }, between functions doesn't checkpatch complain?
> Checked with checkpatch but didn't see any complaining.
>
> >
> > IMHO this hunk should be moved to the prior patch.
> In this patch, we switch to use mm->iommu_mm. That's why the iommu_mm initialization is put in this patch.
>
> I think I met some problem about my mailbox when I was sending this
> new version. It didn't cc iommu@lists.linux.dev. Should I resend
> this version again or reply to the patches with
> iommu@lists.linux.dev cc'd?
Tidy the nits and resend a v8 if addresses got missed
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v7 4/5] iommu: Support mm PASID 1:n with sva domains
2023-10-14 0:03 ` Jason Gunthorpe
@ 2023-10-14 1:02 ` Nicolin Chen
0 siblings, 0 replies; 3+ messages in thread
From: Nicolin Chen @ 2023-10-14 1:02 UTC (permalink / raw)
To: Zhang, Tina, Jason Gunthorpe
Cc: Tian, Kevin, Lu Baolu, Michael Shavit, Vasant Hegde,
linux-kernel@vger.kernel.org, iommu@lists.linux.dev
On Fri, Oct 13, 2023 at 09:03:20PM -0300, Jason Gunthorpe wrote:
> On Fri, Oct 13, 2023 at 09:57:30AM +0000, Zhang, Tina wrote:
> > I think I met some problem about my mailbox when I was sending this
> > new version. It didn't cc iommu@lists.linux.dev. Should I resend
> > this version again or reply to the patches with
> > iommu@lists.linux.dev cc'd?
>
> Tidy the nits and resend a v8 if addresses got missed
I was actually wondering why it missed iommu list. And it likely
missed those maintainers too? Perhaps should run get_maintainer
script and add the person who's going to take the series.
Thanks
Nic
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-14 1:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231012030112.82270-1-tina.zhang@intel.com>
[not found] ` <20231012030112.82270-5-tina.zhang@intel.com>
[not found] ` <20231012134310.GI55194@ziepe.ca>
2023-10-13 9:57 ` [PATCH v7 4/5] iommu: Support mm PASID 1:n with sva domains Zhang, Tina
2023-10-14 0:03 ` Jason Gunthorpe
2023-10-14 1:02 ` Nicolin Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox