Lines Matching refs:pgt_info

16 static struct pgt_info *get_pgt_info(struct hl_ctx *ctx, u64 hop_addr)  in get_pgt_info()
18 struct pgt_info *pgt_info = NULL; in get_pgt_info() local
20 hash_for_each_possible(ctx->mmu_shadow_hash, pgt_info, node, in get_pgt_info()
22 if (hop_addr == pgt_info->shadow_addr) in get_pgt_info()
25 return pgt_info; in get_pgt_info()
28 static void _free_hop(struct hl_ctx *ctx, struct pgt_info *pgt_info) in _free_hop() argument
32 gen_pool_free(hdev->mmu_priv.mmu_pgt_pool, pgt_info->phys_addr, in _free_hop()
34 hash_del(&pgt_info->node); in _free_hop()
35 kfree((u64 *) (uintptr_t) pgt_info->shadow_addr); in _free_hop()
36 kfree(pgt_info); in _free_hop()
41 struct pgt_info *pgt_info = get_pgt_info(ctx, hop_addr); in free_hop() local
43 _free_hop(ctx, pgt_info); in free_hop()
50 struct pgt_info *pgt_info; in alloc_hop() local
53 pgt_info = kmalloc(sizeof(*pgt_info), GFP_KERNEL); in alloc_hop()
54 if (!pgt_info) in alloc_hop()
69 pgt_info->phys_addr = phys_addr; in alloc_hop()
70 pgt_info->shadow_addr = shadow_addr; in alloc_hop()
71 pgt_info->ctx = ctx; in alloc_hop()
72 pgt_info->num_of_ptes = 0; in alloc_hop()
73 hash_add(ctx->mmu_shadow_hash, &pgt_info->node, shadow_addr); in alloc_hop()
81 kfree(pgt_info); in alloc_hop()
158 struct pgt_info *pgt_info = get_pgt_info(ctx, hop_addr); in put_pte() local
161 pgt_info->num_of_ptes--; in put_pte()
167 num_of_ptes_left = pgt_info->num_of_ptes; in put_pte()
169 _free_hop(ctx, pgt_info); in put_pte()
504 struct pgt_info *pgt_info; in hl_mmu_v1_ctx_fini() local
514 hash_for_each_safe(ctx->mmu_shadow_hash, i, tmp, pgt_info, node) { in hl_mmu_v1_ctx_fini()
517 pgt_info->phys_addr, ctx->asid, pgt_info->num_of_ptes); in hl_mmu_v1_ctx_fini()
518 _free_hop(ctx, pgt_info); in hl_mmu_v1_ctx_fini()