linux/drivers/gpu/drm/amd/amdkfd
Harish Kasiviswanathan eac32ff423 drm/amdkfd: Fix GPU mappings for APU after prefetch
Fix the following corner case:-
 Consider a 2M huge page SVM allocation, followed by prefetch call for
the first 4K page. The whole range is initially mapped with single PTE.
After the prefetch, this range gets split to first page + rest of the
pages. Currently, the first page mapping is not updated on MI300A (APU)
since page hasn't migrated. However, after range split PTE mapping it not
valid.

Fix this by forcing page table update for the whole range when prefetch
is called.  Calling prefetch on APU doesn't improve performance. If all
it deteriotes. However, functionality has to be supported.

v2: Use apu_prefer_gtt as this issue doesn't apply to APUs with carveout
VRAM

v3: Simplify by setting the flag for all ASICs as it doesn't affect dGPU

v4: Remove v2 and v3 changes. Force update_mapping when range is split
at a size that is not aligned to prange granularity

Suggested-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Reviewed-by: Philip Yang<Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 076470b9f6)
2025-11-11 22:52:51 -05:00
..
cik_event_interrupt.c drm/amdkfd: Identical code for different branches 2025-05-29 10:56:54 -04:00
cik_int.h
cik_regs.h
cwsr_trap_handler_gfx8.asm
cwsr_trap_handler_gfx9.asm drm/amdkfd: Clear MODE.VSKIP in gfx9 trap handler 2025-01-24 09:53:05 -05:00
cwsr_trap_handler_gfx10.asm drm/amdkfd: Move gfx12 trap handler to separate file 2025-01-09 16:02:56 -05:00
cwsr_trap_handler_gfx12.asm drm/amdkfd: Fix instruction hazard in gfx12 trap handler 2025-03-13 23:12:28 -04:00
cwsr_trap_handler.h drm/amdkfd: Fix instruction hazard in gfx12 trap handler 2025-03-13 23:12:28 -04:00
Kconfig drm/amdkfd: enable kfd on LoongArch systems 2025-07-15 14:07:50 -04:00
kfd_chardev.c drm/amdkfd: Replace kzalloc + copy_from_user with memdup_user 2025-09-15 16:51:48 -04:00
kfd_crat.c drm/amdgpu: simplify xgmi peer info calls 2025-02-25 11:45:12 -05:00
kfd_crat.h
kfd_debug.c drm/amdkfd: delete stray tab in kfd_dbg_set_mes_debug_mode() 2025-03-11 12:36:38 -04:00
kfd_debug.h drm/amdkfd: add gc 9.5.0 support on kfd 2024-12-10 10:26:51 -05:00
kfd_debugfs.c drm/amdkfd: add pasid debugfs entries 2025-04-30 18:06:14 -04:00
kfd_device_queue_manager_cik.c drm/amdkfd: Add support for more per-process flag 2025-03-07 15:33:49 -05:00
kfd_device_queue_manager_v9.c drm/amdkfd: Correct F8_MODE for gfx950 2025-03-13 23:13:12 -04:00
kfd_device_queue_manager_v10.c drm/amdkfd: Add support for more per-process flag 2025-03-07 15:33:49 -05:00
kfd_device_queue_manager_v11.c drm/amdkfd: Add support for more per-process flag 2025-03-07 15:33:49 -05:00
kfd_device_queue_manager_v12.c drm/amdkfd: Add support for more per-process flag 2025-03-07 15:33:49 -05:00
kfd_device_queue_manager_vi.c drm/amdkfd: Add support for more per-process flag 2025-03-07 15:33:49 -05:00
kfd_device_queue_manager.c drm/amdkfd: fix suspend/resume all calls in mes based eviction path 2025-10-13 14:14:28 -04:00
kfd_device_queue_manager.h drm/amdkfd: Add pm_config_dequeue_wait_counts API 2025-03-10 13:23:12 -04:00
kfd_device.c amd/amdkfd: enhance kfd process check in switch partition 2025-09-25 15:53:08 -04:00
kfd_doorbell.c
kfd_events.c drm: amdgpu: Use struct drm_wedge_task_info inside of struct amdgpu_task_info 2025-06-17 11:32:47 -03:00
kfd_events.h
kfd_flat_memory.c drm/amd: Do not include <linux/export.h> when unused 2025-06-30 11:53:45 -04:00
kfd_int_process_v9.c drm/amdkfd: Use dev_* instead of pr_* for messages 2025-04-07 15:18:31 -04:00
kfd_int_process_v10.c drm/amdkfd: drop warning in event_interrupt_isr_v1*() 2025-05-13 09:34:09 -04:00
kfd_int_process_v11.c drm/amdkfd: drop warning in event_interrupt_isr_v1*() 2025-05-13 09:34:09 -04:00
kfd_interrupt.c drm/amdgpu: Show warning message if IH ring overflow 2024-12-18 12:39:07 -05:00
kfd_kernel_queue.c drm/amdkfd: Allow device error to be logged 2025-08-27 13:57:48 -04:00
kfd_kernel_queue.h
kfd_migrate.c amd-drm-next-6.18-2025-09-19: 2025-09-22 08:45:51 +10:00
kfd_migrate.h
kfd_module.c drm/amdkfd: Destroy KFD debugfs after destroy KFD wq 2025-08-06 16:52:08 -04:00
kfd_mqd_manager_cik.c
kfd_mqd_manager_v9.c drm/amdkfd: Fix checkpoint-restore on multi-xcc 2025-08-04 15:38:49 -04:00
kfd_mqd_manager_v10.c drm/amdkfd: Preserve cp_hqd_pq_control on update_mqd 2025-02-25 11:43:58 -05:00
kfd_mqd_manager_v11.c drm/amdkfd: Preserve cp_hqd_pq_control on update_mqd 2025-02-25 11:43:58 -05:00
kfd_mqd_manager_v12.c drm/amdkfd: Preserve cp_hqd_pq_control on update_mqd 2025-02-25 11:43:58 -05:00
kfd_mqd_manager_vi.c
kfd_mqd_manager.c drm/amdkfd: amdkfd_free_gtt_mem clear the correct pointer 2024-07-23 17:34:44 -04:00
kfd_mqd_manager.h
kfd_packet_manager_v9.c drm/amdkfd: Fix race in GWS queue scheduling 2025-06-18 12:19:22 -04:00
kfd_packet_manager_vi.c drm/amdkfd: Add pm_config_dequeue_wait_counts API 2025-03-10 13:23:12 -04:00
kfd_packet_manager.c drm/amdkfd: Support chain runlists of XNACK+/XNACK- 2025-05-16 13:37:29 -04:00
kfd_pm4_headers_ai.h drm/amdkfd: Support chain runlists of XNACK+/XNACK- 2025-05-16 13:37:29 -04:00
kfd_pm4_headers_aldebaran.h drm/amdkfd: Enable processes isolation on gfx9 2024-08-20 22:08:07 -04:00
kfd_pm4_headers_vi.h
kfd_pm4_headers.h
kfd_pm4_opcodes.h
kfd_priv.h amd/amdkfd: enhance kfd process check in switch partition 2025-09-25 15:53:08 -04:00
kfd_process_queue_manager.c drm/amdkfd: Fix checkpoint-restore on multi-xcc 2025-08-04 15:38:49 -04:00
kfd_process.c amd/amdkfd: enhance kfd process check in switch partition 2025-09-25 15:53:08 -04:00
kfd_queue.c drm/amdkfd: relax checks for over allocation of save area 2025-11-11 22:52:27 -05:00
kfd_smi_events.c drm: amdgpu: Use struct drm_wedge_task_info inside of struct amdgpu_task_info 2025-06-17 11:32:47 -03:00
kfd_smi_events.h drm/amdkfd: add smi events for process start and end 2025-04-11 17:01:25 -04:00
kfd_svm.c drm/amdkfd: Fix GPU mappings for APU after prefetch 2025-11-11 22:52:51 -05:00
kfd_svm.h drm/amdkfd: Change svm_range_get_info return type 2025-05-22 12:00:30 -04:00
kfd_topology.c drm/amdkfd: fix p2p links bug in topology 2025-09-05 16:06:43 -04:00
kfd_topology.h drm/amdkfd: flag per-sdma queue reset supported to user space 2025-03-05 10:47:33 -05:00
Makefile drm/amdkfd: remove kfd_pasid.c from amdgpu driver build 2025-02-27 16:50:04 -05:00
soc15_int.h drm/amdkfd: Check int source id for utcl2 poison event 2024-08-23 10:52:33 -04:00