RE: [PATCH RFC] iommu: Enable per-device SSID space for SVA
From: Tian, Kevin
Date: Thu May 07 2026 - 04:15:30 EST
> From: Jason Gunthorpe <jgg@xxxxxxxx>
> Sent: Friday, April 24, 2026 9:40 PM
>
> On Fri, Apr 24, 2026 at 08:53:39AM +0000, Joonwon Kang wrote:
> > For SVA, the IOMMU core always allocates PASID from the global PASID
> > space. The use of this global PASID space comes from the limitation of
> > the ENQCMD instruction in Intel CPUs that it fetches its PASID operand
> > from IA32_PASID, which is per-task.
>
> That's right, and all the iommu drivers should have no issue with
> per-device pasid or they are not following the API contract.. I
> believe that has been taking care of already.
>
> So, I don't think this is an iommu driver capability.
>
> Instead, you have to decide if the PASID is per device or not based on
> if the system will use ENQCMD or any similar instruction. I
> understand ARM has introduced a similar instruction.
>
> So you may be better off with some kind of 'arch has enqcmd like
> instruction' to control this instead of involving the iommu driver.
>
if both arch and device support enqcmd-like insn...
I recalled this was discussed years ago. For devices like this, just
let driver manage its own pasid space then have a new interface
e.g. iommu_sva_bind_device_pasid(dev, mm, pasid) to use the
specified pasid.