Re: [PATCH v7 27/28] iommu/tegra241-cmdqv: Add user-space use support

From: Pranjal Shrivastava
Date: Tue Jul 01 2025 - 21:38:53 EST


On Tue, Jul 01, 2025 at 05:46:06PM -0700, Nicolin Chen wrote:
> On Wed, Jul 02, 2025 at 12:14:28AM +0000, Pranjal Shrivastava wrote:
> > Thus, coming back to the two initial points:
> >
> > 1) Issuing "non-invalidation" commands through .cache_invalidate could
> > be confusing, I'm not asking to change the op name here, but if we
> > plan to label it, let's label them as "Trapped commands" OR
> > "non-accelerated" commands as you suggested.
>
> VCMDQ only accelerates limited invalidation commands, not all of
> them: STE cache invalidation and CD cache invalidation commands
> still go down to that op.
>

Right, I'm just saying the "other" non-accelerated commands that are
NOT invalidations also go down that op. So, if we add a comment, let's
not call them "non-invalidation" commands.

> > 2) The "FIXME" confusion: The comment in arm_vsmmu_cache_invalidate
> > mentions we'd like to "fix" the issuing of commands through the main
> > cmdq and instead like to group by "type", if that "type" is the queue
> > type (which I assume it is because IOMMU_TYPE has to be arm-smmu-v3),
>
> I recall that FIXME is noted by Jason at that time. And it should
> be interpreted as "group by opcode", IIUIC.

I see.. I misunderstood that..

>
> The thing is that for a host kernel that enabled in-kernel VCMDQs,
> those trapped user commands can be just issued to the smmu->cmdq
> or a vcmdq (picked via the get_secondary_cmdq impl_op).
>

Ohh.. so maybe some sort of a load balancing thing?

> > what do we plan to do differently there, given that the op is only
> > for trapped commands *have* to go through the main CMDQ?
>
> If we do something differently there, it could just do a one-time
> get_secondary_cmdq call to pick a in-kernel vcmdq over smmu->cmdq
> to fill in all the trapped commands.
>

Alright.

> And this is not related to this series at all.

Agreed, sorry for the confusion then.. I thought that the "type" meant
the queue type.. I guess it's all done then. I have no further questions

Thanks for the clarification!

>
> Nicolin

Praan