linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: "iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"robin.murphy@arm.com" <robin.murphy@arm.com>,
	"will@kernel.org" <will@kernel.org>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"ryan.roberts@arm.com" <ryan.roberts@arm.com>,
	"kevin.tian@intel.com" <kevin.tian@intel.com>,
	"nicolinc@nvidia.com" <nicolinc@nvidia.com>,
	"mshavit@google.com" <mshavit@google.com>,
	"eric.auger@redhat.com" <eric.auger@redhat.com>,
	"joao.m.martins@oracle.com" <joao.m.martins@oracle.com>,
	jiangkunkun <jiangkunkun@huawei.com>,
	zhukeqian <zhukeqian1@huawei.com>, Linuxarm <linuxarm@huawei.com>
Subject: RE: [PATCH v4 2/7] iommu/arm-smmu-v3: Factor out a common arm_smmu_domain_alloc()
Date: Wed, 5 Jun 2024 15:19:09 +0000	[thread overview]
Message-ID: <b459e54b6a324eb8993c6c7f37dfde06@huawei.com> (raw)
In-Reply-To: <ZluNbvTNlABEz0QT@nvidia.com>



> -----Original Message-----
> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Saturday, June 1, 2024 10:07 PM
> To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
> Cc: iommu@lists.linux.dev; linux-arm-kernel@lists.infradead.org;
> robin.murphy@arm.com; will@kernel.org; joro@8bytes.org;
> ryan.roberts@arm.com; kevin.tian@intel.com; nicolinc@nvidia.com;
> mshavit@google.com; eric.auger@redhat.com; joao.m.martins@oracle.com;
> jiangkunkun <jiangkunkun@huawei.com>; zhukeqian
> <zhukeqian1@huawei.com>; Linuxarm <linuxarm@huawei.com>
> Subject: Re: [PATCH v4 2/7] iommu/arm-smmu-v3: Factor out a common
> arm_smmu_domain_alloc()
> 
> On Tue, May 28, 2024 at 08:18:26AM +0100, Shameer Kolothum wrote:
> 
> > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
> > @@ -648,7 +648,7 @@ static int arm_smmu_sva_set_dev_pasid(struct
> iommu_domain *domain,
> >
> >  static void arm_smmu_sva_domain_free(struct iommu_domain *domain)
> >  {
> > -	kfree(domain);
> > +	kfree(to_smmu_domain(domain));
> >  }
> 
> 
> > @@ -659,13 +659,16 @@ static const struct iommu_domain_ops
> arm_smmu_sva_domain_ops = {
> >  struct iommu_domain *arm_smmu_sva_domain_alloc(struct device *dev,
> >  					       struct mm_struct *mm)
> >  {
> > -	struct iommu_domain *domain;
> > +	struct arm_smmu_master *master = dev_iommu_priv_get(dev);
> > +	struct arm_smmu_device *smmu = master->smmu;
> > +	struct arm_smmu_domain *smmu_domain;
> >
> > -	domain = kzalloc(sizeof(*domain), GFP_KERNEL);
> > -	if (!domain)
> > -		return ERR_PTR(-ENOMEM);
> > -	domain->type = IOMMU_DOMAIN_SVA;
> > -	domain->ops = &arm_smmu_sva_domain_ops;
> > +	smmu_domain = arm_smmu_domain_alloc();
> > +	if (IS_ERR(smmu_domain))
> > +		return ERR_CAST(smmu_domain);
> > +	smmu_domain->domain.type = IOMMU_DOMAIN_SVA;
> > +	smmu_domain->domain.ops = &arm_smmu_sva_domain_ops;
> > +	smmu_domain->smmu = smmu;
> >
> > -	return domain;
> > +	return &smmu_domain->domain;
> >  }
> 
> If you drop these two hunks you can drop the first patch as well. There
> is no need to touch SVA in this series

That is right. I will make those changes and re-spin soon.

Thanks,
SHameer

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-06-05 15:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28  7:18 [PATCH v4 0/7] iommu/smmuv3: Add IOMMUFD dirty tracking support for SMMUv3 Shameer Kolothum
2024-05-28  7:18 ` [PATCH v4 1/7] iommu/arm-smmu-v3: Convert to domain_alloc_sva() Shameer Kolothum
2024-05-28  7:18 ` [PATCH v4 2/7] iommu/arm-smmu-v3: Factor out a common arm_smmu_domain_alloc() Shameer Kolothum
2024-06-01 21:06   ` Jason Gunthorpe
2024-06-05 15:19     ` Shameerali Kolothum Thodi [this message]
2024-05-28  7:18 ` [PATCH v4 3/7] iommu/arm-smmu-v3: Add support for domain_alloc_user fn Shameer Kolothum
2024-06-01 21:08   ` Jason Gunthorpe
2024-05-28  7:18 ` [PATCH v4 4/7] iommu/arm-smmu-v3: Add feature detection for HTTU Shameer Kolothum
2024-05-28  7:18 ` [PATCH v4 5/7] iommu/io-pgtable-arm: Add read_and_clear_dirty() support Shameer Kolothum
2024-06-01 21:17   ` Jason Gunthorpe
2024-05-28  7:18 ` [PATCH v4 6/7] iommu/arm-smmu-v3: Add support for dirty tracking in domain alloc Shameer Kolothum
2024-05-28  7:18 ` [PATCH v4 7/7] iommu/arm-smmu-v3: Enable HTTU for stage1 with io-pgtable mapping Shameer Kolothum

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=b459e54b6a324eb8993c6c7f37dfde06@huawei.com \
    --to=shameerali.kolothum.thodi@huawei.com \
    --cc=eric.auger@redhat.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=jiangkunkun@huawei.com \
    --cc=joao.m.martins@oracle.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linuxarm@huawei.com \
    --cc=mshavit@google.com \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.com \
    --cc=ryan.roberts@arm.com \
    --cc=will@kernel.org \
    --cc=zhukeqian1@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).