Lines Matching refs:hop_idx

176 					u64 *hop_addr_arr, u64 virt_addr, enum mmu_hop_num hop_idx)  in get_hop_pte_addr()  argument
180 mask = mmu_prop->hop_masks[hop_idx]; in get_hop_pte_addr()
181 shift = mmu_prop->hop_shifts[hop_idx]; in get_hop_pte_addr()
182 return hop_addr_arr[hop_idx] + in get_hop_pte_addr()
491 int hop_idx; in hl_mmu_v1_unmap() local
496 for (hop_idx = MMU_HOP0; hop_idx < MMU_HOP4; hop_idx++) { in hl_mmu_v1_unmap()
497 if (hop_idx == MMU_HOP0) { in hl_mmu_v1_unmap()
498 hop_addr[hop_idx] = get_hop0_addr(ctx); in hl_mmu_v1_unmap()
500 hop_addr[hop_idx] = hl_mmu_get_next_hop_addr(ctx, curr_pte); in hl_mmu_v1_unmap()
501 if (hop_addr[hop_idx] == ULLONG_MAX) in hl_mmu_v1_unmap()
505 hop_pte_addr[hop_idx] = in hl_mmu_v1_unmap()
506 get_hop_pte_addr(ctx, mmu_prop, hop_addr, virt_addr, hop_idx); in hl_mmu_v1_unmap()
508 curr_pte = *(u64 *) (uintptr_t) hop_pte_addr[hop_idx]; in hl_mmu_v1_unmap()
519 hop_idx = MMU_HOP4; in hl_mmu_v1_unmap()
520 hop_addr[hop_idx] = hl_mmu_get_next_hop_addr(ctx, curr_pte); in hl_mmu_v1_unmap()
521 if (hop_addr[hop_idx] == ULLONG_MAX) in hl_mmu_v1_unmap()
524 hop_pte_addr[hop_idx] = in hl_mmu_v1_unmap()
525 get_hop_pte_addr(ctx, mmu_prop, hop_addr, virt_addr, hop_idx); in hl_mmu_v1_unmap()
526 curr_pte = *(u64 *) (uintptr_t) hop_pte_addr[hop_idx]; in hl_mmu_v1_unmap()
548 hop_idx = MMU_HOP3; in hl_mmu_v1_unmap()
549 write_final_pte(ctx, hop_pte_addr[hop_idx], default_pte); in hl_mmu_v1_unmap()
550 put_pte(ctx, hop_addr[hop_idx]); in hl_mmu_v1_unmap()
566 for (hop_idx = MMU_HOP3; hop_idx >= 0; hop_idx--) { in hl_mmu_v1_unmap()
567 clear_pte(ctx, hop_pte_addr[hop_idx]); in hl_mmu_v1_unmap()
569 if (hop_idx == MMU_HOP0) in hl_mmu_v1_unmap()
572 if (put_pte(ctx, hop_addr[hop_idx])) in hl_mmu_v1_unmap()
595 int num_hops, hop_idx, prev_hop, rc = -ENOMEM; in hl_mmu_v1_map() local
617 for (hop_idx = MMU_HOP0; hop_idx < num_hops; hop_idx++) { in hl_mmu_v1_map()
618 if (hop_idx == MMU_HOP0) { in hl_mmu_v1_map()
619 hop_addr[hop_idx] = get_hop0_addr(ctx); in hl_mmu_v1_map()
621 hop_addr[hop_idx] = in hl_mmu_v1_map()
622 get_alloc_next_hop_addr(ctx, curr_pte, &hop_new[hop_idx]); in hl_mmu_v1_map()
623 if (hop_addr[hop_idx] == ULLONG_MAX) in hl_mmu_v1_map()
627 hop_pte_addr[hop_idx] = in hl_mmu_v1_map()
628 get_hop_pte_addr(ctx, mmu_prop, hop_addr, virt_addr, hop_idx); in hl_mmu_v1_map()
629 curr_pte = *(u64 *) (uintptr_t) hop_pte_addr[hop_idx]; in hl_mmu_v1_map()
645 for (hop_idx = MMU_HOP1; hop_idx < num_hops; hop_idx++) { in hl_mmu_v1_map()
646 if (hop_new[hop_idx]) { in hl_mmu_v1_map()
657 for (hop_idx = MMU_HOP0; hop_idx < num_hops; hop_idx++) in hl_mmu_v1_map()
658 dev_dbg(hdev->dev, "hop%d pte: 0x%llx (0x%llx)\n", hop_idx, in hl_mmu_v1_map()
659 *(u64 *) (uintptr_t) hop_pte_addr[hop_idx], in hl_mmu_v1_map()
660 hop_pte_addr[hop_idx]); in hl_mmu_v1_map()
671 for (hop_idx = MMU_HOP1; hop_idx < num_hops; hop_idx++) { in hl_mmu_v1_map()
672 prev_hop = hop_idx - 1; in hl_mmu_v1_map()
674 if (hop_new[hop_idx]) { in hl_mmu_v1_map()
675 curr_pte = (hop_addr[hop_idx] & HOP_PHYS_ADDR_MASK) | PAGE_PRESENT_MASK; in hl_mmu_v1_map()
677 if (hop_idx != MMU_HOP1) in hl_mmu_v1_map()
687 for (hop_idx = num_hops; hop_idx > MMU_HOP0; hop_idx--) { in hl_mmu_v1_map()
688 if (hop_new[hop_idx]) in hl_mmu_v1_map()
689 free_hop(ctx, hop_addr[hop_idx]); in hl_mmu_v1_map()