Following review feedback, this series reuses the existing global
amdgpu_pasid_xa infrastructure as the single PASID ownership table
instead of introducing a new PASID mapping.
For DRM PASIDs, amdgpu_pasid_xa now tracks:
PASID -> amdgpu_fpriv
and VM users derive the VM through:
PASID -> fpriv -> VM
This allows all PASID users to share a single ownership table while
removing the dedicated vm_manager.pasids infrastructure.
For this RFC, lifetime handling is intentionally kept simple.
Existing VM fault users resolve PASID ownership while holding the
PASID XA lock and acquire a reference on the VM root BO before
dropping the lock.
Future asynchronous users (EVENTFD, debugger notifications,
WAIT_EVENT, etc.) may require additional lifetime protection if
they need to continue using the owner after dropping the PASID
XA lock.
One possible future direction is:
PASID -> refcounted owner object -> fpriv
for example:
struct amdgpu_pasid_owner {
struct kref refcount;
struct amdgpu_fpriv *fpriv;
};
That is intentionally left for later discussion when a real
asynchronous user is added.
Open discussion points:
- Is PASID -> fpriv -> VM the preferred long-term routing
model for process-scoped events?
- Future asynchronous users may require additional lifetime
protection beyond the current lock-based lookup model.
Only compilation tested.
Srinivasan Shanmugam (4):
drm/amdgpu: Add PASID fpriv ownership helpers
drm/amdgpu: Register DRM PASID ownership
drm/amdgpu: Resolve VM through DRM PASID ownership
drm/amdgpu: Drop vm_manager PASID to VM mapping
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 91 +++++++++++++++++++++++++
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.h | 13 ++++
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 17 +++--
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 59 +++++++---------
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 4 --
5 files changed, 140 insertions(+), 44 deletions(-)
--
2.34.1