[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aDnojjuMUqMbIRTb@Asurada-Nvidia>
Date: Fri, 30 May 2025 10:19:10 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: <kevin.tian@...el.com>, <corbet@....net>, <will@...nel.org>,
<bagasdotme@...il.com>, <robin.murphy@....com>, <joro@...tes.org>,
<thierry.reding@...il.com>, <vdumpa@...dia.com>, <jonathanh@...dia.com>,
<shuah@...nel.org>, <jsnitsel@...hat.com>, <nathan@...nel.org>,
<peterz@...radead.org>, <yi.l.liu@...el.com>, <mshavit@...gle.com>,
<praan@...gle.com>, <zhangzekun11@...wei.com>, <iommu@...ts.linux.dev>,
<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-tegra@...r.kernel.org>,
<linux-kselftest@...r.kernel.org>, <patches@...ts.linux.dev>,
<mochs@...dia.com>, <alok.a.tiwari@...cle.com>, <vasant.hegde@....com>,
<dwmw2@...radead.org>, <baolu.lu@...ux.intel.com>
Subject: Re: [PATCH v5 28/29] iommu/tegra241-cmdqv: Add user-space use support
On Fri, May 30, 2025 at 02:10:52PM -0300, Jason Gunthorpe wrote:
> On Sat, May 17, 2025 at 08:21:45PM -0700, Nicolin Chen wrote:
> > +static inline phys_addr_t
> > +arm_smmu_domain_ipa_to_pa(struct arm_smmu_domain *smmu_domain, u64 ipa)
> > +{
> > + if (WARN_ON_ONCE(smmu_domain->stage != ARM_SMMU_DOMAIN_S2))
> > + return 0;
> > + return iommu_iova_to_phys(&smmu_domain->domain, ipa);
> > +}
>
> It is not allowed to call this function unless you are holding a range
> lock on the IOAS that covers ipa, and this path does not.
>
> This is why it has to go through an access to get the physical as that
> has the right locking.
OK. It would not be needed either once the core passes in type
phys_addr_t as you suggested in the other patch.
Thanks
Nicolin
Powered by blists - more mailing lists