Lines Matching defs:pgt_info

780 	struct pgt_info *hop0_pgt;
825 struct pgt_info *hop0_pgt;
842 hr_priv->mmu_asid_hop0 = kvcalloc(prop->max_asid, sizeof(struct pgt_info), GFP_KERNEL);
925 * @pgt_info: page table info structure.
929 void hl_mmu_hr_free_hop_remove_pgt(struct pgt_info *pgt_info, struct hl_mmu_hr_priv *hr_priv,
932 gen_pool_free(hr_priv->mmu_pgt_pool, pgt_info->virt_addr, hop_table_size);
933 hash_del(&pgt_info->node);
934 kfree(pgt_info);
940 * @pgt: pgt_info for the HOP hosting the PTE
946 * The function use the pgt_info to get HOP base virt addr and obtain the PTE's virt addr
949 u64 hl_mmu_hr_pte_phys_to_virt(struct hl_ctx *ctx, struct pgt_info *pgt,
961 * @pgt_info: HOP's page table info structure
966 void hl_mmu_hr_write_pte(struct hl_ctx *ctx, struct pgt_info *pgt_info, u64 phys_pte_addr,
973 u64 virt_addr = hl_mmu_hr_pte_phys_to_virt(ctx, pgt_info, phys_pte_addr, hop_table_size);
981 * @pgt_info: HOP's page table info structure
985 void hl_mmu_hr_clear_pte(struct hl_ctx *ctx, struct pgt_info *pgt_info, u64 phys_pte_addr,
989 hl_mmu_hr_write_pte(ctx, pgt_info, phys_pte_addr, 0, hop_table_size);
995 * @pgt_info: HOP's page table info structure
1001 int hl_mmu_hr_put_pte(struct hl_ctx *ctx, struct pgt_info *pgt_info,
1007 pgt_info->num_of_ptes--;
1011 * the pgt_info
1013 num_of_ptes_left = pgt_info->num_of_ptes;
1015 hl_mmu_hr_free_hop_remove_pgt(pgt_info, hr_priv, hop_table_size);
1032 * hl_mmu_hr_get_next_hop_pgt_info() - get pgt_info structure for the next HOP
1037 * @return pgt_info structure on success, otherwise NULL.
1039 struct pgt_info *hl_mmu_hr_get_next_hop_pgt_info(struct hl_ctx *ctx,
1058 * @return pgt_info structure associated with the allocated HOP on success, otherwise NULL.
1060 struct pgt_info *hl_mmu_hr_alloc_hop(struct hl_ctx *ctx, struct hl_mmu_hr_priv *hr_priv,
1065 struct pgt_info *pgt_info;
1070 pgt_info = kmalloc(sizeof(*pgt_info), GFP_KERNEL);
1071 if (!pgt_info)
1101 pgt_info->phys_addr = phys_addr;
1102 pgt_info->shadow_addr = (unsigned long) NULL;
1103 pgt_info->virt_addr = (unsigned long)virt_addr;
1104 pgt_info->ctx = ctx;
1105 pgt_info->num_of_ptes = 0;
1106 hr_func->add_pgt_info(ctx, pgt_info, phys_addr);
1108 return pgt_info;
1111 kfree(pgt_info);
1125 * @return pgt_info structure associated with the allocated HOP on success, otherwise NULL.
1127 struct pgt_info *hl_mmu_hr_get_alloc_next_hop(struct hl_ctx *ctx,
1155 struct pgt_info *hops_pgt_info[MMU_ARCH_6_HOPS] = { NULL };
1215 struct pgt_info *hl_mmu_dr_get_pgt_info(struct hl_ctx *ctx, u64 hop_addr)
1217 struct pgt_info *pgt_info = NULL;
1219 hash_for_each_possible(ctx->mmu_shadow_hash, pgt_info, node,
1221 if (hop_addr == pgt_info->shadow_addr)
1224 return pgt_info;
1229 struct pgt_info *pgt_info = hl_mmu_dr_get_pgt_info(ctx, hop_addr);
1231 hl_mmu_dr_free_pgt_node(ctx, pgt_info);
1234 void hl_mmu_dr_free_pgt_node(struct hl_ctx *ctx, struct pgt_info *pgt_info)
1238 gen_pool_free(hdev->mmu_priv.dr.mmu_pgt_pool, pgt_info->phys_addr,
1240 hash_del(&pgt_info->node);
1241 kfree((u64 *) (uintptr_t) pgt_info->shadow_addr);
1242 kfree(pgt_info);
1301 struct pgt_info *pgt_info = hl_mmu_dr_get_pgt_info(ctx, hop_addr);
1304 pgt_info->num_of_ptes--;
1308 * the pgt_info
1310 num_of_ptes_left = pgt_info->num_of_ptes;
1312 hl_mmu_dr_free_pgt_node(ctx, pgt_info);
1321 struct pgt_info *pgt_info;
1324 pgt_info = kmalloc(sizeof(*pgt_info), GFP_KERNEL);
1325 if (!pgt_info)
1340 pgt_info->phys_addr = phys_addr;
1341 pgt_info->shadow_addr = shadow_addr;
1342 pgt_info->ctx = ctx;
1343 pgt_info->num_of_ptes = 0;
1344 hash_add(ctx->mmu_shadow_hash, &pgt_info->node, shadow_addr);
1352 kfree(pgt_info);