Lines Matching defs:pgt_info
784 struct pgt_info *hop0_pgt;
829 struct pgt_info *hop0_pgt;
846 hr_priv->mmu_asid_hop0 = kvcalloc(prop->max_asid, sizeof(struct pgt_info), GFP_KERNEL);
929 * @pgt_info: page table info structure.
933 void hl_mmu_hr_free_hop_remove_pgt(struct pgt_info *pgt_info, struct hl_mmu_hr_priv *hr_priv,
936 gen_pool_free(hr_priv->mmu_pgt_pool, pgt_info->virt_addr, hop_table_size);
937 hash_del(&pgt_info->node);
938 kfree(pgt_info);
944 * @pgt: pgt_info for the HOP hosting the PTE
950 * The function use the pgt_info to get HOP base virt addr and obtain the PTE's virt addr
953 u64 hl_mmu_hr_pte_phys_to_virt(struct hl_ctx *ctx, struct pgt_info *pgt,
965 * @pgt_info: HOP's page table info structure
970 void hl_mmu_hr_write_pte(struct hl_ctx *ctx, struct pgt_info *pgt_info, u64 phys_pte_addr,
977 u64 virt_addr = hl_mmu_hr_pte_phys_to_virt(ctx, pgt_info, phys_pte_addr, hop_table_size);
985 * @pgt_info: HOP's page table info structure
989 void hl_mmu_hr_clear_pte(struct hl_ctx *ctx, struct pgt_info *pgt_info, u64 phys_pte_addr,
993 hl_mmu_hr_write_pte(ctx, pgt_info, phys_pte_addr, 0, hop_table_size);
999 * @pgt_info: HOP's page table info structure
1005 int hl_mmu_hr_put_pte(struct hl_ctx *ctx, struct pgt_info *pgt_info,
1011 pgt_info->num_of_ptes--;
1015 * the pgt_info
1017 num_of_ptes_left = pgt_info->num_of_ptes;
1019 hl_mmu_hr_free_hop_remove_pgt(pgt_info, hr_priv, hop_table_size);
1036 * hl_mmu_hr_get_next_hop_pgt_info() - get pgt_info structure for the next HOP
1041 * @return pgt_info structure on success, otherwise NULL.
1043 struct pgt_info *hl_mmu_hr_get_next_hop_pgt_info(struct hl_ctx *ctx,
1062 * @return pgt_info structure associated with the allocated HOP on success, otherwise NULL.
1064 struct pgt_info *hl_mmu_hr_alloc_hop(struct hl_ctx *ctx, struct hl_mmu_hr_priv *hr_priv,
1069 struct pgt_info *pgt_info;
1074 pgt_info = kmalloc(sizeof(*pgt_info), GFP_KERNEL);
1075 if (!pgt_info)
1105 pgt_info->phys_addr = phys_addr;
1106 pgt_info->shadow_addr = (unsigned long) NULL;
1107 pgt_info->virt_addr = (unsigned long)virt_addr;
1108 pgt_info->ctx = ctx;
1109 pgt_info->num_of_ptes = 0;
1110 hr_func->add_pgt_info(ctx, pgt_info, phys_addr);
1112 return pgt_info;
1115 kfree(pgt_info);
1129 * @return pgt_info structure associated with the allocated HOP on success, otherwise NULL.
1131 struct pgt_info *hl_mmu_hr_get_alloc_next_hop(struct hl_ctx *ctx,
1159 struct pgt_info *hops_pgt_info[MMU_ARCH_6_HOPS] = { NULL };
1219 struct pgt_info *hl_mmu_dr_get_pgt_info(struct hl_ctx *ctx, u64 hop_addr)
1221 struct pgt_info *pgt_info = NULL;
1223 hash_for_each_possible(ctx->mmu_shadow_hash, pgt_info, node,
1225 if (hop_addr == pgt_info->shadow_addr)
1228 return pgt_info;
1233 struct pgt_info *pgt_info = hl_mmu_dr_get_pgt_info(ctx, hop_addr);
1235 hl_mmu_dr_free_pgt_node(ctx, pgt_info);
1238 void hl_mmu_dr_free_pgt_node(struct hl_ctx *ctx, struct pgt_info *pgt_info)
1242 gen_pool_free(hdev->mmu_priv.dr.mmu_pgt_pool, pgt_info->phys_addr,
1244 hash_del(&pgt_info->node);
1245 kfree((u64 *) (uintptr_t) pgt_info->shadow_addr);
1246 kfree(pgt_info);
1305 struct pgt_info *pgt_info = hl_mmu_dr_get_pgt_info(ctx, hop_addr);
1308 pgt_info->num_of_ptes--;
1312 * the pgt_info
1314 num_of_ptes_left = pgt_info->num_of_ptes;
1316 hl_mmu_dr_free_pgt_node(ctx, pgt_info);
1325 struct pgt_info *pgt_info;
1328 pgt_info = kmalloc(sizeof(*pgt_info), GFP_KERNEL);
1329 if (!pgt_info)
1344 pgt_info->phys_addr = phys_addr;
1345 pgt_info->shadow_addr = shadow_addr;
1346 pgt_info->ctx = ctx;
1347 pgt_info->num_of_ptes = 0;
1348 hash_add(ctx->mmu_shadow_hash, &pgt_info->node, shadow_addr);
1356 kfree(pgt_info);