]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu: GPU vm support 5-level page table
authorPhilip Yang <Philip.Yang@amd.com>
Fri, 25 Apr 2025 14:55:07 +0000 (10:55 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Dec 2025 18:56:30 +0000 (13:56 -0500)
commitf6b1c1f5fd7237f77fc3880603ea54dcf0371a20
tree8fdfe18b0369e43cceb0fbbdac51eaf272b7ec80
parentbc5094e27e10259df655c45629c5e234957bbfb6
drm/amdgpu: GPU vm support 5-level page table

If GPU supports 5-level page table, but CPU disable 5-level page table
by using boot option no5lvl or CPU feature not available, the virtual
address will be 48bit, not needed to enable 5-level page table on GPU
vm.

If adev->vm_manager.num_level, number of pde levels, set to 4, then
gfxhub and mmhub register VM_CONTEXTx_CNTL/PAGE_TABLE_DEPTH will set
to 4 to enable 5-level page table in page table walker.

Set vm_manager.root_level to AMDGPU_VM_PDE3, then update GPU mapping
will allocate and update PDE3/PDE2/PDE1/PDE0/PTB 5-level page tables.

If max_level is not 4, no change for the logic to support features
needed by old ASICs.

v2: squash in CONFIG fix

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Acked-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c