| /linux/drivers/gpu/drm/amd/amdkfd/ |
| H A D | kfd_doorbell.c | 50 size_t kfd_doorbell_process_slice(struct kfd_dev *kfd) in kfd_doorbell_process_slice() argument 52 if (!kfd->shared_resources.enable_mes) in kfd_doorbell_process_slice() 53 return roundup(kfd->device_info.doorbell_size * in kfd_doorbell_process_slice() 58 (struct amdgpu_device *)kfd->adev); in kfd_doorbell_process_slice() 62 int kfd_doorbell_init(struct kfd_dev *kfd) in kfd_doorbell_init() argument 75 kfd->doorbell_bitmap = bitmap_zalloc(size / sizeof(u32), GFP_KERNEL); in kfd_doorbell_init() 76 if (!kfd->doorbell_bitmap) { in kfd_doorbell_init() 82 r = amdgpu_bo_create_kernel(kfd->adev, in kfd_doorbell_init() 86 &kfd->doorbells, in kfd_doorbell_init() 88 (void **)&kfd->doorbell_kernel_ptr); in kfd_doorbell_init() [all …]
|
| H A D | kfd_interrupt.c | 58 KFD_IH_NUM_ENTRIES * node->kfd->device_info.ih_ring_entry_size, in kfd_interrupt_init() 65 if (!node->kfd->ih_wq) { in kfd_interrupt_init() 66 node->kfd->ih_wq = alloc_workqueue("KFD IH", WQ_HIGHPRI | WQ_UNBOUND, in kfd_interrupt_init() 67 node->kfd->num_nodes); in kfd_interrupt_init() 68 if (unlikely(!node->kfd->ih_wq)) { in kfd_interrupt_init() 116 kfifo_in(&node->ih_fifo, ih_ring_entry, node->kfd->device_info.ih_ring_entry_size); in enqueue_ih_ring_entry() 131 node->kfd->device_info.ih_ring_entry_size); in dequeue_ih_ring_entry() 132 WARN_ON(count != node->kfd->device_info.ih_ring_entry_size); in dequeue_ih_ring_entry() 133 return count == node->kfd->device_info.ih_ring_entry_size; in dequeue_ih_ring_entry() 143 dev->kfd->device_info.event_interrupt_class->interrupt_wq(dev, in interrupt_wq() [all …]
|
| H A D | kfd_kernel_queue.c | 64 prop.doorbell_ptr = kfd_get_kernel_doorbell(dev->kfd, &prop.doorbell_off); in kq_initialize() 102 retval = kfd_gtt_sa_allocate(dev, dev->kfd->device_info.doorbell_size, in kq_initialize() 113 memset(kq->wptr_kernel, 0, dev->kfd->device_info.doorbell_size); in kq_initialize() 165 kfd_release_kernel_doorbell(dev->kfd, prop.doorbell_ptr); in kq_initialize() 196 kfd_release_kernel_doorbell(kq->dev->kfd, in kq_uninitialize() 281 if (kq->dev->kfd->device_info.doorbell_size == 8) { in kq_submit_packet() 298 if (kq->dev->kfd->device_info.doorbell_size == 8) { in kq_rollback_packet()
|
| H A D | kfd_debug.h | 115 && dev->kfd->mec2_fw_version < 0x81b6) || in kfd_dbg_has_gws_support() 118 && dev->kfd->mec2_fw_version < 0x1b6) || in kfd_dbg_has_gws_support() 120 && dev->kfd->mec2_fw_version < 0x1b6) || in kfd_dbg_has_gws_support() 122 && dev->kfd->mec2_fw_version < 0x30) || in kfd_dbg_has_gws_support()
|
| H A D | kfd_mqd_manager_vi.c | 81 struct kfd_node *kfd = mm->dev; in allocate_mqd() local 84 if (kfd_gtt_sa_allocate(kfd, sizeof(struct vi_mqd), in allocate_mqd() 138 if (mm->dev->kfd->cwsr_enabled && q->ctx_save_restore_area_address) { in init_mqd() 151 mutex_lock(&mm->dev->kfd->profiler_lock); in init_mqd() 152 if (mm->dev->kfd->profiler_process != NULL) in init_mqd() 154 mutex_unlock(&mm->dev->kfd->profiler_lock); in init_mqd() 234 if (mm->dev->kfd->cwsr_enabled && q->ctx_save_restore_area_address) in __update_mqd()
|
| H A D | kfd_mqd_manager_v10.c | 78 struct kfd_node *kfd = mm->dev; in allocate_mqd() local 81 if (kfd_gtt_sa_allocate(kfd, sizeof(struct v10_compute_mqd), in allocate_mqd() 130 if (mm->dev->kfd->cwsr_enabled) { in init_mqd() 143 mutex_lock(&mm->dev->kfd->profiler_lock); in init_mqd() 144 if (mm->dev->kfd->profiler_process != NULL) in init_mqd() 147 mutex_unlock(&mm->dev->kfd->profiler_lock); in init_mqd() 225 if (mm->dev->kfd->cwsr_enabled) in update_mqd()
|
| H A D | kfd_mqd_manager_v11.c | 170 if (mm->dev->kfd->cwsr_enabled) { in init_mqd() 183 mutex_lock(&mm->dev->kfd->profiler_lock); in init_mqd() 184 if (mm->dev->kfd->profiler_process != NULL) in init_mqd() 186 mutex_unlock(&mm->dev->kfd->profiler_lock); in init_mqd() 263 if (mm->dev->kfd->cwsr_enabled) in update_mqd() 435 if (mm->dev->kfd->shared_resources.enable_mes) in init_mqd_sdma() 586 if (dev->kfd->shared_resources.enable_mes) { in mqd_manager_init_v11()
|
| H A D | kfd_process.c | 161 dqm->dev->kfd->device_info.num_sdma_queues_per_engine, in kfd_sdma_activity_worker() 1179 mutex_lock(&pdd->dev->kfd->profiler_lock); in kfd_process_profiler_release() 1180 if (pdd->dev->kfd->profiler_process == p) { in kfd_process_profiler_release() 1182 pdd->dev->kfd->profiler_process = NULL; in kfd_process_profiler_release() 1184 mutex_unlock(&pdd->dev->kfd->profiler_lock); in kfd_process_profiler_release() 1215 kfd_free_process_doorbells(pdd->dev->kfd, pdd); in kfd_process_destroy_pdds() 1217 if (pdd->dev->kfd->shared_resources.enable_mes && in kfd_process_destroy_pdds() 1233 atomic_dec(&pdd->dev->kfd->kfd_processes_count); in kfd_process_destroy_pdds() 1521 if (!dev->kfd->cwsr_enabled || !iosys_map_is_null(&qpd->cwsr_map) || !qpd->cwsr_base) in kfd_process_device_init_cwsr_dgpu() 1546 iosys_map_memcpy_to(&qpd->cwsr_map, 0, dev->kfd->cwsr_isa, in kfd_process_device_init_cwsr_dgpu() [all …]
|
| H A D | kfd_mqd_manager_v12.c | 145 if (mm->dev->kfd->cwsr_enabled) { in init_mqd() 158 mutex_lock(&mm->dev->kfd->profiler_lock); in init_mqd() 159 if (mm->dev->kfd->profiler_process != NULL) in init_mqd() 161 mutex_unlock(&mm->dev->kfd->profiler_lock); in init_mqd() 238 if (mm->dev->kfd->cwsr_enabled) in update_mqd()
|
| H A D | kfd_chardev.c | 388 err = kfd_alloc_process_doorbells(dev->kfd, pdd); in kfd_ioctl_create_queue() 1049 if (dev->kfd->adev->debug_largebar) { in kfd_dev_is_large_bar() 1059 dev->kfd->adev->gmc.is_app_apu) { in kfd_dev_is_large_bar() 1162 if (args->size != kfd_doorbell_process_slice(dev->kfd)) { in kfd_ioctl_alloc_memory_of_gpu() 1446 flush_tlb = kfd_flush_tlb_after_unmap(pdd->dev->kfd); in kfd_ioctl_unmap_memory_from_gpu() 1558 args->gpu_id = dmabuf_adev->kfd.dev->nodes[xcp_id]->id; in kfd_ioctl_get_dmabuf_info() 1874 if (!pdd || !pdd->dev || !pdd->dev->kfd) in kfd_profiler_ptl_control() 2415 ret = kfd_alloc_process_doorbells(dev->kfd, pdd); in criu_restore_devices() 2447 kfd_doorbell_process_slice(pdd->dev->kfd)) in criu_restore_memory_of_gpu() 2923 if (pdd->dev->kfd->shared_resources.enable_mes) { in runtime_enable() [all …]
|
| H A D | kfd_process_queue_manager.c | 94 if (dev->kfd->shared_resources.enable_mes && !!pdd->proc_ctx_gpu_addr && in kfd_process_dequeue_from_device() 141 !dev->kfd->shared_resources.enable_mes) { in pqm_set_gws() 206 !dev->kfd->shared_resources.enable_mes) in pqm_clean_queue_resource() 212 if (dev->kfd->shared_resources.enable_mes) { in pqm_clean_queue_resource() 268 if (dev->kfd->shared_resources.enable_mes) { in init_user_queue() 366 max_queues = dev->kfd->device_info.max_no_of_hqd/2; in pqm_create_queue() 386 if (!pdd->proc_ctx_cpu_ptr && dev->kfd->shared_resources.enable_mes) { in pqm_create_queue() 486 pdd->dev->kfd->device_info.doorbell_size); in pqm_create_queue()
|
| H A D | kfd_crat.c | 1661 kfd_fill_gpu_cache_info_from_gfx_config_v2(kdev->kfd, in kfd_get_gpu_cache_info() 1738 kfd_fill_gpu_cache_info_from_gfx_config(kdev->kfd, in kfd_get_gpu_cache_info() 2209 bool use_ta_info = kdev->kfd->num_nodes == 1; in kfd_fill_gpu_xgmi_link_to_gpu() 2235 bool is_single_hop = kdev->kfd == peer_kdev->kfd; in kfd_fill_gpu_xgmi_link_to_gpu() 2304 (cu_info->number / kdev->kfd->num_nodes); in kfd_create_vcrat_image_gpu() 2379 if (kdev->kfd->hive_id) { in kfd_create_vcrat_image_gpu() 2384 if (peer_dev->gpu->kfd->hive_id != kdev->kfd->hive_id) in kfd_create_vcrat_image_gpu()
|
| H A D | kfd_mqd_manager_v12_1.c | 62 cu_active_per_node = cu_info->number / mm->dev->kfd->num_nodes; in mqd_symmetrically_map_cu_mask_v12_1() 206 if (mm->dev->kfd->cwsr_enabled) { in init_mqd() 316 if (mm->dev->kfd->cwsr_enabled) in update_mqd() 475 if (mm->dev->kfd->cwsr_enabled && in init_mqd_v12_1()
|
| H A D | kfd_migrate.c | 216 return (addr + adev->kfd.pgmap.range.start) >> PAGE_SHIFT; in svm_migrate_addr_to_pfn() 246 return (addr - adev->kfd.pgmap.range.start); in svm_migrate_addr() 1028 struct amdgpu_kfd_dev *kfddev = &adev->kfd; in kgd2kfd_init_zone_device()
|
| H A D | kfd_svm.c | 187 bo_adev->kfd.pgmap.range.start; in svm_range_dma_map_dev() 2167 for (i = 0; i < adev->kfd.dev->num_nodes; i++) { in svm_range_set_max_pages() 2168 if (adev->kfd.dev->nodes[i]->xcp) in svm_range_set_max_pages() 2169 id = adev->kfd.dev->nodes[i]->xcp->id; in svm_range_set_max_pages()
|
| /linux/drivers/gpu/drm/amd/amdgpu/ |
| H A D | amdgpu_amdkfd.h | 431 bool kgd2kfd_device_init(struct kfd_dev *kfd, 433 void kgd2kfd_device_exit(struct kfd_dev *kfd); 434 void kgd2kfd_suspend(struct kfd_dev *kfd, bool suspend_proc); 435 int kgd2kfd_resume(struct kfd_dev *kfd, bool resume_proc); 436 void kgd2kfd_suspend_process(struct kfd_dev *kfd); 437 int kgd2kfd_resume_process(struct kfd_dev *kfd); 438 int kgd2kfd_pre_reset(struct kfd_dev *kfd, 440 int kgd2kfd_post_reset(struct kfd_dev *kfd); 441 void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry); 442 void kgd2kfd_set_sram_ecc_flag(struct kfd_dev *kfd); [all …]
|
| H A D | amdgpu_amdkfd.c | 81 adev->kfd.dev = kgd2kfd_probe(adev, vf); in amdgpu_amdkfd_device_probe() 132 kfd.reset_work); in amdgpu_amdkfd_reset_work() 156 if (!adev->kfd.init_complete || adev->kfd.client.dev) in amdgpu_amdkfd_drm_client_create() 159 ret = drm_client_init(&adev->ddev, &adev->kfd.client, "kfd", in amdgpu_amdkfd_drm_client_create() 167 drm_client_register(&adev->kfd.client); in amdgpu_amdkfd_drm_client_create() 179 if (adev->kfd.dev) { in amdgpu_amdkfd_device_init() 230 adev->kfd.init_complete = kgd2kfd_device_init(adev->kfd.dev, in amdgpu_amdkfd_device_init() 235 INIT_WORK(&adev->kfd.reset_work, amdgpu_amdkfd_reset_work); in amdgpu_amdkfd_device_init() 241 if (adev->kfd.dev) { in amdgpu_amdkfd_device_fini_sw() 242 kgd2kfd_device_exit(adev->kfd.dev); in amdgpu_amdkfd_device_fini_sw() [all …]
|
| H A D | amdgpu_amdkfd_gpuvm.c | 239 if (adev->kfd.vram_used[xcp_id] + vram_needed > vram_available) { in amdgpu_amdkfd_reserve_mem_limit() 251 adev->kfd.vram_used[xcp_id] += vram_needed; in amdgpu_amdkfd_reserve_mem_limit() 252 adev->kfd.vram_used_aligned[xcp_id] += in amdgpu_amdkfd_reserve_mem_limit() 280 adev->kfd.vram_used[xcp_id] -= size; in amdgpu_amdkfd_unreserve_mem_limit() 282 adev->kfd.vram_used_aligned[xcp_id] -= size; in amdgpu_amdkfd_unreserve_mem_limit() 286 adev->kfd.vram_used_aligned[xcp_id] -= in amdgpu_amdkfd_unreserve_mem_limit() 298 WARN_ONCE(adev && xcp_id >= 0 && adev->kfd.vram_used[xcp_id] < 0, in amdgpu_amdkfd_unreserve_mem_limit() 825 dmabuf = drm_gem_prime_handle_to_dmabuf(&bo_adev->ddev, bo_adev->kfd.client.file, in kfd_mem_export_dmabuf() 1677 - adev->kfd.vram_used_aligned[xcp_id]; in amdgpu_amdkfd_get_available_memory() 1680 - adev->kfd.vram_used_aligned[xcp_id] in amdgpu_amdkfd_get_available_memory() [all …]
|
| H A D | amdgpu_gfx.c | 1177 kgd2kfd_set_sram_ecc_flag(adev->kfd.dev); in amdgpu_gfx_process_ras_data_cb() 2559 if (adev->kfd.init_complete) in amdgpu_gfx_kfd_sch_ctrl() 2618 if (adev->kfd.init_complete) in amdgpu_gfx_enforce_isolation_handler() 2712 if (adev->kfd.init_complete) in amdgpu_gfx_enforce_isolation_ring_begin_use() 2749 if (adev->kfd.init_complete) in amdgpu_gfx_enforce_isolation_ring_end_use()
|
| H A D | amdgpu_device.c | 5391 if (adev->kfd.dev) in amdgpu_device_stop_pending_resets() 5392 cancel_work(&adev->kfd.reset_work); in amdgpu_device_stop_pending_resets() 5651 if (!adev->kfd.init_complete) in amdgpu_device_gpu_resume()
|
| /linux/samples/bpf/ |
| H A D | task_fd_query_user.c | 234 int err = -1, res, kfd, efd; in test_debug_fs_uprobe() local 240 kfd = open(buf, O_WRONLY | O_TRUNC, 0); in test_debug_fs_uprobe() 241 CHECK_PERROR_RET(kfd < 0); in test_debug_fs_uprobe() 250 CHECK_PERROR_RET(write(kfd, buf, strlen(buf)) < 0); in test_debug_fs_uprobe() 252 close(kfd); in test_debug_fs_uprobe() 253 kfd = -1; in test_debug_fs_uprobe() 270 kfd = sys_perf_event_open(&attr, -1, 0, -1, PERF_FLAG_FD_CLOEXEC); in test_debug_fs_uprobe() 271 link = bpf_program__attach_perf_event(progs[0], kfd); in test_debug_fs_uprobe() 275 close(kfd); in test_debug_fs_uprobe() 280 err = bpf_task_fd_query(getpid(), kfd, 0, buf, &len, in test_debug_fs_uprobe()
|
| /linux/tools/perf/ |
| H A D | builtin-probe.c | 442 int ret, ret2, ufd = -1, kfd = -1; in perf_del_probe_events() local 456 ret = probe_file__open_both(&kfd, &ufd, PF_FL_RW); in perf_del_probe_events() 467 ret = probe_file__get_events(kfd, filter, klist); in perf_del_probe_events() 472 ret = probe_file__del_strlist(kfd, klist); in perf_del_probe_events() 495 if (kfd >= 0) in perf_del_probe_events() 496 close(kfd); in perf_del_probe_events()
|
| /linux/tools/perf/util/ |
| H A D | probe-file.c | 153 int probe_file__open_both(int *kfd, int *ufd, int flag) in probe_file__open_both() argument 155 if (!kfd || !ufd) in probe_file__open_both() 158 *kfd = open_kprobe_events(flag & PF_FL_RW); in probe_file__open_both() 160 if (*kfd < 0 && *ufd < 0) { in probe_file__open_both() 161 print_both_open_warning(*kfd, *ufd, flag & PF_FL_RW); in probe_file__open_both() 162 return *kfd; in probe_file__open_both()
|