[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXju0DkpGxjsiJK2@Asurada-Nvidia>
Date: Tue, 27 Jan 2026 08:58:56 -0800
From: Nicolin Chen <nicolinc@...dia.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: <will@...nel.org>, <robin.murphy@....com>, <joro@...tes.org>,
<jpb@...nel.org>, <praan@...gle.com>, <miko.lenczewski@....com>,
<linux-arm-kernel@...ts.infradead.org>, <iommu@...ts.linux.dev>,
<linux-kernel@...r.kernel.org>, <patches@...ts.linux.dev>
Subject: Re: [PATCH v2 01/10] iommu/arm-smmu-v3: Store IOTLB cache tags in
struct arm_smmu_attach_state
On Tue, Jan 27, 2026 at 11:08:48AM -0400, Jason Gunthorpe wrote:
> On Mon, Jan 26, 2026 at 07:23:58PM -0800, Nicolin Chen wrote:
> > On Mon, Jan 26, 2026 at 04:44:43PM -0400, Jason Gunthorpe wrote:
> > > On Wed, Jan 21, 2026 at 05:24:19PM -0800, Nicolin Chen wrote:
> > > > +int arm_smmu_domain_get_iotlb_tag(struct arm_smmu_domain *smmu_domain,
> > > > + struct arm_smmu_device *smmu,
> > > > + struct arm_smmu_inv *tag)
> > > > +{
> > > > + /* Decide the type of the iotlb cache tag */
> > > > + switch (smmu_domain->stage) {
> > > > + case ARM_SMMU_DOMAIN_SVA:
> > > > + case ARM_SMMU_DOMAIN_S1:
> > > > + tag->type = INV_TYPE_S1_ASID;
> > > > + break;
> > > > + case ARM_SMMU_DOMAIN_S2:
> > > > + tag->type = INV_TYPE_S2_VMID;
> > > > + break;
> > > > + default:
> > > > + return -EINVAL;
> > > > + }
> > > > +
> > > > + tag->smmu = smmu;
> > > > +
> > > > + if (tag->type == INV_TYPE_S1_ASID)
> > > > + tag->id = smmu_domain->cd.asid;
> > > > + else
> > > > + tag->id = smmu_domain->s2_cfg.vmid;
> > >
> > > Would be tidier to move these up into the case
> >
> > This will act as a fake allocation path in PATCh-3 and eventually
> > get replaced with a real allocation piece in PATCH-4. So, I wrote
> > like this in a transitory manner.
>
> I'd still write it in the nice way, you can remove the lines later
> when you add the allocation logic.
OK. I will keep them in the first switch statement.
This would instead make the get() in PATCH-3 a fake logic until
PATCH-4 replacing them with a real allocation logic. Should work
in the same way.
Thanks
Nicolin
Powered by blists - more mailing lists