[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXjxss9H3NQ/qe+m@Asurada-Nvidia>
Date: Tue, 27 Jan 2026 09:11:14 -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 06/10] iommu/arm-smmu-v3: Allocate vmid in
arm_vsmmu_init
On Tue, Jan 27, 2026 at 11:11:38AM -0400, Jason Gunthorpe wrote:
> On Mon, Jan 26, 2026 at 07:06:24PM -0800, Nicolin Chen wrote:
> > On Mon, Jan 26, 2026 at 05:16:36PM -0400, Jason Gunthorpe wrote:
> > > On Wed, Jan 21, 2026 at 05:24:24PM -0800, Nicolin Chen wrote:
> > > > VMID owned by a vSMMU should be allocated in the viommu_init callback, as
> > > > HW like tegra241-cmdqv needs to setup VINTF with the VMID.
> > >
> > > Even the architected SMMU needs this, the VMS (not implemented in
> > > Linux) should all share the same VMID for the same VM.
> >
> > But for standard SMMU, the allocation/sharing could happen at the
> > device attachment to a nested (maybe bypass proxy) domain, right?
> >
> > vmid is only needed for STE (attach) and invalidation.
> >
> > Or do you see some other case where vmid must be allocated during
> > viommu_init?
>
> It has to be tied to the VSMMU, it doesn't matter if a single VMID is
> allocated on-demand for the VSMMU or for the lifetime, it has to be a
> single ID and shared across all STEs.
Attachment threads are mutexed. Any device that attaches firstly
will allocate a shareable tag and add it to the array. Any other
device will get the tag from the array and reuse it. And nothing
will change this.
> It is easy to understand that lifecycle by just allocating it for the
> lifetime of the VSMMU..
Yea, it makes sense for that matter.
So, perhaps:
VMID owned by a vSMMU should be allocated in the viommu_init callback for
- a straightforward lifecycle for a VMID used by a vSMMU
- HW like tegra241-cmdqv needs to setup VINTF with the VMID
Thanks
Nicolin
Powered by blists - more mailing lists