Lines Matching refs:hnode
1056 struct hl_vm_hash_node *hnode; in map_device_va() local
1155 hnode = kzalloc(sizeof(*hnode), GFP_KERNEL); in map_device_va()
1156 if (!hnode) { in map_device_va()
1214 hnode->ptr = vm_type; in map_device_va()
1215 hnode->vaddr = ret_vaddr; in map_device_va()
1216 hnode->handle = is_userptr ? MEM_HANDLE_INVALID : handle; in map_device_va()
1219 hash_add(ctx->mem_hash, &hnode->node, ret_vaddr); in map_device_va()
1237 kfree(hnode); in map_device_va()
1253 struct hl_vm_hash_node *hnode; in get_vm_hash_node_locked() local
1255 hash_for_each_possible(ctx->mem_hash, hnode, node, vaddr) in get_vm_hash_node_locked()
1256 if (vaddr == hnode->vaddr) in get_vm_hash_node_locked()
1257 return hnode; in get_vm_hash_node_locked()
1280 struct hl_vm_hash_node *hnode; in unmap_device_va() local
1290 hnode = get_vm_hash_node_locked(ctx, vaddr); in unmap_device_va()
1291 if (!hnode) { in unmap_device_va()
1297 if (hnode->export_cnt) { in unmap_device_va()
1303 hash_del(&hnode->node); in unmap_device_va()
1306 vm_type = hnode->ptr; in unmap_device_va()
1310 userptr = hnode->ptr; in unmap_device_va()
1329 phys_pg_pack = hnode->ptr; in unmap_device_va()
1388 kfree(hnode); in unmap_device_va()
1402 hash_add(ctx->mem_hash, &hnode->node, vaddr); in unmap_device_va()
1792 struct hl_vm_hash_node *hnode; in memhash_node_export_get() local
1796 hnode = get_vm_hash_node_locked(ctx, addr); in memhash_node_export_get()
1797 if (!hnode) { in memhash_node_export_get()
1803 if (upper_32_bits(hnode->handle)) { in memhash_node_export_get()
1806 hnode->handle, addr); in memhash_node_export_get()
1814 hnode->export_cnt++; in memhash_node_export_get()
1817 return hnode; in memhash_node_export_get()
1820 static void memhash_node_export_put(struct hl_ctx *ctx, struct hl_vm_hash_node *hnode) in memhash_node_export_put() argument
1823 hnode->export_cnt--; in memhash_node_export_put()
1986 struct hl_vm_hash_node *hnode) in get_phys_pg_pack_from_hash_node() argument
1992 phys_pg_pack = idr_find(&vm->phys_pg_pack_handles, (u32) hnode->handle); in get_phys_pg_pack_from_hash_node()
1995 dev_dbg(hdev->dev, "no match for handle 0x%x\n", (u32) hnode->handle); in get_phys_pg_pack_from_hash_node()
2002 dev_dbg(hdev->dev, "handle 0x%llx does not represent DRAM memory\n", hnode->handle); in get_phys_pg_pack_from_hash_node()
2029 struct hl_vm_hash_node *hnode = NULL; in export_dmabuf_from_addr() local
2049 hnode = memhash_node_export_get(ctx, addr); in export_dmabuf_from_addr()
2050 if (IS_ERR(hnode)) { in export_dmabuf_from_addr()
2051 rc = PTR_ERR(hnode); in export_dmabuf_from_addr()
2054 phys_pg_pack = get_phys_pg_pack_from_hash_node(hdev, hnode); in export_dmabuf_from_addr()
2064 hl_dmabuf->memhash_hnode = hnode; in export_dmabuf_from_addr()
2082 memhash_node_export_put(ctx, hnode); in export_dmabuf_from_addr()
2747 struct hl_vm_hash_node *hnode; in hl_vm_ctx_fini() local
2767 hash_for_each_safe(ctx->mem_hash, i, tmp_node, hnode, node) { in hl_vm_ctx_fini()
2770 hnode->vaddr, ctx->asid); in hl_vm_ctx_fini()
2771 args.unmap.device_virt_addr = hnode->vaddr; in hl_vm_ctx_fini()