]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdkfd: Override KFD SVM mappings for GFX 12.1
authorMukul Joshi <mukul.joshi@amd.com>
Wed, 16 Jul 2025 16:42:40 +0000 (12:42 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Dec 2025 18:29:10 +0000 (13:29 -0500)
Override the local MTYPE mappings in KFD SVM code with mtype_local
modprobe param for GFX 12.1.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Alex Sierra <alex.sierra@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_svm.c

index 3235774f3b64c9ec35099e66878d4bf7c2957335..1ed08388d364653b121d214a19126496a4f86a4d 100644 (file)
@@ -1309,9 +1309,11 @@ svm_range_get_pte_flags(struct kfd_node *node, struct amdgpu_vm *vm,
        case IP_VERSION(12, 1, 0):
                snoop = true;
                if (domain == SVM_RANGE_VRAM_DOMAIN) {
+                       mtype_local = amdgpu_mtype_local == 1 ? AMDGPU_VM_MTYPE_NC :
+                                                               AMDGPU_VM_MTYPE_RW;
                        /* local HBM  */
                        if (bo_node->adev == node->adev)
-                               mapping_flags |= AMDGPU_VM_MTYPE_RW;
+                               mapping_flags |= mtype_local;
                        /* Remote GPU memory */
                        else
                                mapping_flags |= ext_coherent ? AMDGPU_VM_MTYPE_UC :