AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: "SHANMUGAM, SRINIVASAN" <SRINIVASAN.SHANMUGAM@amd.com>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>
Cc: "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v4 3/3] drm/amdgpu: Drop vm_manager PASID to VM mapping
Date: Tue, 7 Jul 2026 15:04:29 +0200	[thread overview]
Message-ID: <7645febb-2256-4e39-bcbe-3b61dab7db80@amd.com> (raw)
In-Reply-To: <IA0PR12MB82085C8E4A1E00B94B602B8B90F42@IA0PR12MB8208.namprd12.prod.outlook.com>

On 7/3/26 12:36, SHANMUGAM, SRINIVASAN wrote:
> AMD General
> 
> Hi Christian,
> 
>> -----Original Message-----
>> From: Koenig, Christian <Christian.Koenig@amd.com>
>> Sent: Friday, July 3, 2026 1:14 PM
>> To: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM@amd.com>;
>> Deucher, Alexander <Alexander.Deucher@amd.com>
>> Cc: amd-gfx@lists.freedesktop.org
>> Subject: Re: [PATCH v4 3/3] drm/amdgpu: Drop vm_manager PASID to VM
>> mapping
>>
>> On 7/3/26 08:18, Srinivasan Shanmugam wrote:
>>> VM lookup users now resolve DRM PASIDs through the global PASID xarray:
>>>
>>>     PASID -> fpriv -> VM
>>>
>>> The per-device vm_manager.pasids xarray is no longer needed.
>>>
>>> Remove PASID registration and teardown from VM init/fini paths, drop
>>> vm_manager PASID initialization/cleanup, and remove the xarray from
>>> struct amdgpu_vm_manager.
>>>
>>> Cc: Alex Deucher <alexander.deucher@amd.com>
>>> Cc: Christian König <christian.koenig@amd.com>
>>> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
>>> ---
>>>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 25 ++-----------------------
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h |  4 ----
>>>  2 files changed, 2 insertions(+), 27 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>> index 9092ff227a55..74836240edbb 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
>>> @@ -2647,14 +2647,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev,
>> struct amdgpu_vm *vm,
>>>     if (r)
>>>             dev_dbg(adev->dev, "Failed to create task info for VM\n");
>>>
>>> -   /* Store new PASID in XArray (if non-zero) */
>>> -   if (pasid != 0) {
>>> -           r = xa_err(xa_store_irq(&adev->vm_manager.pasids, pasid, vm,
>> GFP_KERNEL));
>>> -           if (r < 0)
>>> -                   goto error_free_root;
>>> -
>>> -           vm->pasid = pasid;
>>> -   }
>>> +   vm->pasid = pasid;
>>
>> What do we actually still need the pasid in the VM for?
> 
> I checked the remaining vm->pasid users. It looks like vm->pasid is still needed for existing hardware programming paths (TLB flushes, PASID mapping packets, tracepoints, etc.), while this series only removes the separate vm_manager.pasids lookup table.

Ah, yes. Especially the TLB flushes are a good point.

> 
> My understanding is therefore that:
> 
> vm->pasid
>     remains as per-VM state
> 
> vm_manager.pasids
>     can be removed because lookups now go
>     PASID -> fpriv -> VM
> 
> May I kno pls, does that match your expectation, or were you thinking of removing vm->pasid as well?

Please go ahead with the current plan of removing vm_manager.pasids but keeping vm->pasid.

Thanks,
Christian.

> 
> Regards,
> Srini
> 
>>
>> Regards,
>> Christian.


      reply	other threads:[~2026-07-07 13:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03  6:18 [PATCH v4 0/3] Add PASID to fpriv lookup infrastructure Srinivasan Shanmugam
2026-07-03  6:18 ` [PATCH v4 1/3] drm/amdgpu: Allow PASID allocator to store fpriv owner Srinivasan Shanmugam
2026-07-03  7:38   ` Christian König
2026-07-03 15:00     ` SHANMUGAM, SRINIVASAN
2026-07-03  6:18 ` [PATCH v4 2/3] drm/amdgpu: Resolve VM through DRM PASID ownership Srinivasan Shanmugam
2026-07-03  7:42   ` Christian König
2026-07-03  6:18 ` [PATCH v4 3/3] drm/amdgpu: Drop vm_manager PASID to VM mapping Srinivasan Shanmugam
2026-07-03  7:44   ` Christian König
2026-07-03 10:36     ` SHANMUGAM, SRINIVASAN
2026-07-07 13:04       ` Christian König [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7645febb-2256-4e39-bcbe-3b61dab7db80@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=SRINIVASAN.SHANMUGAM@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox