On 9/29/26 19:13, Khatri, Sunil wrote: > > On 29-09-2026 08:26 pm, Mukul Joshi wrote: >> >> >> On 9/29/2026 8:04 AM, Christian König wrote: >>> On 9/28/26 20:57, Sunil Khatri wrote: >>>> The RLC bring-up paths programmed the RLC_SPM_VMID field to a hardcoded >>>> 0xf as the idle default. Now that the dedicated SPM VMID is tracked in >>>> vm_manager.spm_vmid, use it directly so the idle default matches the >>>> VMID the reservation path hands out. >>>> >>>> No functional change: spm_vmid is the top VMID (0xf) on all affected >>>> generations (gfx7 through gfx12). >> >> I don't see the full series for some reason so pointing it out here. >> >> We are reserving and using VMID 15 for NPA VMs currently on GFX 12.1. >> >> Currently, we are using it only on MMHUB. But this may change in the future. >> >> So maybe refrain from using the same VMID 15. >> > @christian, > Whats you suggestion here on using the vmid15 suggestion that Mukul has > shared.
As Mukul wrote as well for now that is rather unproblematic since we only need VMID 15 for NPA on the MMHUB and for SPM on the GFXHUB. But we should really note all special VMIDs usages in the vm_manager and abstract the reserved usages using proper functions in amdgpu_ids.c. Something like funktions to return the VMIDs which should be used for kernel queues (CS IOCTL) and user queues (MES, old HWS/KFD). That should give us enough flexibility to change things for future HW generations. Regards, Christian. >> >> Also, since I can't see the full series, please look at gmc_v12_0_sw_init() >> on how we are reserving the VMID. >> > I am not sure Mukul why you arent seeing the full series... I am aware of the > NPA VMID 15 reservation in MMHUB and I will check have a look at > gmc_v12_0_sw_init. > > Regards > Sunil Khatri > >> >> Regards, >> >> Mukul >> >> >>> You also need to remove all the calls to >>> adev->gfx.rlc.funcs->update_spm_vmid from amdgpu_vm_flush() and >>> amdgpu_ib_schedule(). >>> >>> Regards, >>> Christian. >>> >>>> Signed-off-by: Sunil Khatri<[email protected]> >>>> --- >>>> drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 ++-- >>>> drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +- >>>> drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 2 +- >>>> drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 2 +- >>>> drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 +- >>>> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 +- >>>> drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +- >>>> drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 2 +- >>>> 8 files changed, 9 insertions(+), 9 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c >>>> b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c >>>> index 33403e16df5ca..88f9f0b0bf524 100644 >>>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c >>>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c >>>> @@ -5583,7 +5583,7 @@ static int gfx_v10_0_rlc_resume(struct amdgpu_device >>>> *adev) >>>> gfx_v10_0_init_csb(adev); >>>> - gfx_v10_0_update_spm_vmid_internal(adev, 0xf); >>>> + gfx_v10_0_update_spm_vmid_internal(adev, >>>> adev->vm_manager.spm_vmid); >>>> if (!amdgpu_sriov_vf(adev)) /* enable RLC SRM */ >>>> gfx_v10_0_rlc_enable_srm(adev); >>>> @@ -5615,7 +5615,7 @@ static int gfx_v10_0_rlc_resume(struct amdgpu_device >>>> *adev) >>>> gfx_v10_0_init_csb(adev); >>>> - gfx_v10_0_update_spm_vmid_internal(adev, 0xf); >>>> + gfx_v10_0_update_spm_vmid_internal(adev, >>>> adev->vm_manager.spm_vmid); >>>> adev->gfx.rlc.funcs->start(adev); >>>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c >>>> b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c >>>> index 7bfc8cbdcad85..036d1b7ade4e6 100644 >>>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c >>>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c >>>> @@ -944,7 +944,7 @@ static int gfx_v11_0_rlc_init(struct amdgpu_device >>>> *adev) >>>> /* init spm vmid with 0xf */ >>>> if (adev->gfx.rlc.funcs->update_spm_vmid) >>>> - adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf); >>>> + adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, >>>> adev->vm_manager.spm_vmid); >>>> return 0; >>>> } >>>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c >>>> b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c >>>> index b75512e7b1db6..4caa43ff50a1b 100644 >>>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c >>>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c >>>> @@ -773,7 +773,7 @@ static int gfx_v12_0_rlc_init(struct amdgpu_device >>>> *adev) >>>> /* init spm vmid with 0xf */ >>>> if (adev->gfx.rlc.funcs->update_spm_vmid) >>>> - adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf); >>>> + adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, >>>> adev->vm_manager.spm_vmid); >>>> return 0; >>>> } >>>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c >>>> b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c >>>> index 91764f2e5ad01..a3d72cbaa6cf1 100644 >>>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c >>>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c >>>> @@ -1848,7 +1848,7 @@ static int gfx_v12_1_xcc_rlc_resume(struct >>>> amdgpu_device *adev, >>>> int r; >>>> /* init spm vmid with 0xf */ >>>> - gfx_v12_1_update_spm_vmid(adev, xcc_id, NULL, 0xf); >>>> + gfx_v12_1_update_spm_vmid(adev, xcc_id, NULL, >>>> adev->vm_manager.spm_vmid); >>>> if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) { >>>> gfx_v12_1_xcc_init_csb(adev, xcc_id); >>>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c >>>> b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c >>>> index 549d1239e326b..04ee7e1725a94 100644 >>>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c >>>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c >>>> @@ -3252,7 +3252,7 @@ static int gfx_v7_0_rlc_init(struct amdgpu_device >>>> *adev) >>>> /* init spm vmid with 0xf */ >>>> if (adev->gfx.rlc.funcs->update_spm_vmid) >>>> - adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf); >>>> + adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, >>>> adev->vm_manager.spm_vmid); >>>> return 0; >>>> } >>>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c >>>> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c >>>> index ab4123ddbb942..61ba71b57b8e2 100644 >>>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c >>>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c >>>> @@ -1274,7 +1274,7 @@ static int gfx_v8_0_rlc_init(struct amdgpu_device >>>> *adev) >>>> /* init spm vmid with 0xf */ >>>> if (adev->gfx.rlc.funcs->update_spm_vmid) >>>> - adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf); >>>> + adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, >>>> adev->vm_manager.spm_vmid); >>>> return 0; >>>> } >>>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c >>>> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c >>>> index 1678015ce5a97..4862d17a58237 100644 >>>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c >>>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c >>>> @@ -3240,7 +3240,7 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device >>>> *adev) >>>> break; >>>> } >>>> - gfx_v9_0_update_spm_vmid_internal(adev, 0xf); >>>> + gfx_v9_0_update_spm_vmid_internal(adev, adev->vm_manager.spm_vmid); >>>> adev->gfx.rlc.funcs->start(adev); >>>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c >>>> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c >>>> index 01ed1701c781a..add8099cf8e05 100644 >>>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c >>>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c >>>> @@ -1395,7 +1395,7 @@ static int gfx_v9_4_3_rlc_init(struct amdgpu_device >>>> *adev) >>>> { >>>> /* init spm vmid with 0xf */ >>>> if (adev->gfx.rlc.funcs->update_spm_vmid) >>>> - adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf); >>>> + adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, >>>> adev->vm_manager.spm_vmid); >>>> return 0; >>>> }
