• Home
  • Raw
  • Download

Lines Matching refs:tbl

207 		struct iommu_table *tbl = container->tables[i];  in tce_iommu_find_table()  local
209 if (tbl) { in tce_iommu_find_table()
210 unsigned long entry = ioba >> tbl->it_page_shift; in tce_iommu_find_table()
211 unsigned long start = tbl->it_offset; in tce_iommu_find_table()
212 unsigned long end = start + tbl->it_size; in tce_iommu_find_table()
215 *ptbl = tbl; in tce_iommu_find_table()
337 struct iommu_table *tbl,
340 struct iommu_table *tbl);
360 struct iommu_table *tbl = container->tables[i]; in tce_iommu_release() local
362 if (!tbl) in tce_iommu_release()
365 tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size); in tce_iommu_release()
366 tce_iommu_free_table(container, tbl); in tce_iommu_release()
410 struct iommu_table *tbl, unsigned long entry) in tce_iommu_unuse_page_v2() argument
415 __be64 *pua = IOMMU_TABLE_USERSPACE_ENTRY_RO(tbl, entry); in tce_iommu_unuse_page_v2()
421 tbl->it_page_shift, &hpa, &mem); in tce_iommu_unuse_page_v2()
432 struct iommu_table *tbl, in tce_iommu_clear() argument
441 if (tbl->it_indirect_levels && tbl->it_userspace) { in tce_iommu_clear()
450 __be64 *pua = IOMMU_TABLE_USERSPACE_ENTRY_RO(tbl, in tce_iommu_clear()
454 entry |= tbl->it_level_size - 1; in tce_iommu_clear()
463 ret = iommu_tce_xchg_no_kill(container->mm, tbl, entry, &oldhpa, in tce_iommu_clear()
472 tce_iommu_unuse_page_v2(container, tbl, entry); in tce_iommu_clear()
479 iommu_tce_kill(tbl, firstentry, pages); in tce_iommu_clear()
500 struct iommu_table *tbl, in tce_iommu_build() argument
509 unsigned long offset = tce & IOMMU_PAGE_MASK(tbl) & ~PAGE_MASK; in tce_iommu_build()
516 tbl->it_page_shift)) { in tce_iommu_build()
523 ret = iommu_tce_xchg_no_kill(container->mm, tbl, entry + i, in tce_iommu_build()
528 __func__, entry << tbl->it_page_shift, in tce_iommu_build()
536 tce += IOMMU_PAGE_SIZE(tbl); in tce_iommu_build()
540 tce_iommu_clear(container, tbl, entry, i); in tce_iommu_build()
542 iommu_tce_kill(tbl, entry, pages); in tce_iommu_build()
548 struct iommu_table *tbl, in tce_iommu_build_v2() argument
558 __be64 *pua = IOMMU_TABLE_USERSPACE_ENTRY(tbl, entry + i); in tce_iommu_build_v2()
561 tce, tbl->it_page_shift, &hpa, &mem); in tce_iommu_build_v2()
566 tbl->it_page_shift)) { in tce_iommu_build_v2()
572 hpa |= tce & IOMMU_PAGE_MASK(tbl) & ~PAGE_MASK; in tce_iommu_build_v2()
579 ret = iommu_tce_xchg_no_kill(container->mm, tbl, entry + i, in tce_iommu_build_v2()
583 tce_iommu_unuse_page_v2(container, tbl, entry + i); in tce_iommu_build_v2()
585 __func__, entry << tbl->it_page_shift, in tce_iommu_build_v2()
591 tce_iommu_unuse_page_v2(container, tbl, entry + i); in tce_iommu_build_v2()
595 tce += IOMMU_PAGE_SIZE(tbl); in tce_iommu_build_v2()
599 tce_iommu_clear(container, tbl, entry, i); in tce_iommu_build_v2()
601 iommu_tce_kill(tbl, entry, pages); in tce_iommu_build_v2()
635 struct iommu_table *tbl) in tce_iommu_free_table() argument
637 unsigned long pages = tbl->it_allocated_size >> PAGE_SHIFT; in tce_iommu_free_table()
639 iommu_tce_table_put(tbl); in tce_iommu_free_table()
649 struct iommu_table *tbl = NULL; in tce_iommu_create_window() local
673 page_shift, window_size, levels, &tbl); in tce_iommu_create_window()
677 BUG_ON(!tbl->it_ops->free); in tce_iommu_create_window()
686 ret = table_group->ops->set_window(table_group, num, tbl); in tce_iommu_create_window()
691 container->tables[num] = tbl; in tce_iommu_create_window()
694 *start_addr = tbl->it_offset << tbl->it_page_shift; in tce_iommu_create_window()
703 tce_iommu_free_table(container, tbl); in tce_iommu_create_window()
712 struct iommu_table *tbl; in tce_iommu_remove_window() local
716 num = tce_iommu_find_table(container, start_addr, &tbl); in tce_iommu_remove_window()
720 BUG_ON(!tbl->it_size); in tce_iommu_remove_window()
740 tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size); in tce_iommu_remove_window()
741 tce_iommu_free_table(container, tbl); in tce_iommu_remove_window()
857 struct iommu_table *tbl = NULL; in tce_iommu_ioctl() local
880 num = tce_iommu_find_table(container, param.iova, &tbl); in tce_iommu_ioctl()
884 if ((param.size & ~IOMMU_PAGE_MASK(tbl)) || in tce_iommu_ioctl()
885 (param.vaddr & ~IOMMU_PAGE_MASK(tbl))) in tce_iommu_ioctl()
901 ret = iommu_tce_put_param_check(tbl, param.iova, param.vaddr); in tce_iommu_ioctl()
906 ret = tce_iommu_build_v2(container, tbl, in tce_iommu_ioctl()
907 param.iova >> tbl->it_page_shift, in tce_iommu_ioctl()
909 param.size >> tbl->it_page_shift, in tce_iommu_ioctl()
912 ret = tce_iommu_build(container, tbl, in tce_iommu_ioctl()
913 param.iova >> tbl->it_page_shift, in tce_iommu_ioctl()
915 param.size >> tbl->it_page_shift, in tce_iommu_ioctl()
918 iommu_flush_tce(tbl); in tce_iommu_ioctl()
924 struct iommu_table *tbl = NULL; in tce_iommu_ioctl() local
947 num = tce_iommu_find_table(container, param.iova, &tbl); in tce_iommu_ioctl()
951 if (param.size & ~IOMMU_PAGE_MASK(tbl)) in tce_iommu_ioctl()
954 ret = iommu_tce_clear_param_check(tbl, param.iova, 0, in tce_iommu_ioctl()
955 param.size >> tbl->it_page_shift); in tce_iommu_ioctl()
959 ret = tce_iommu_clear(container, tbl, in tce_iommu_ioctl()
960 param.iova >> tbl->it_page_shift, in tce_iommu_ioctl()
961 param.size >> tbl->it_page_shift); in tce_iommu_ioctl()
962 iommu_flush_tce(tbl); in tce_iommu_ioctl()
1147 struct iommu_table *tbl = container->tables[i]; in tce_iommu_release_ownership() local
1149 if (!tbl) in tce_iommu_release_ownership()
1152 tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size); in tce_iommu_release_ownership()
1153 if (tbl->it_map) in tce_iommu_release_ownership()
1154 iommu_release_ownership(tbl); in tce_iommu_release_ownership()
1166 struct iommu_table *tbl = table_group->tables[i]; in tce_iommu_take_ownership() local
1168 if (!tbl || !tbl->it_map) in tce_iommu_take_ownership()
1171 rc = iommu_take_ownership(tbl); in tce_iommu_take_ownership()
1219 struct iommu_table *tbl = container->tables[i]; in tce_iommu_take_ownership_ddw() local
1221 if (!tbl) in tce_iommu_take_ownership_ddw()
1224 ret = table_group->ops->set_window(table_group, i, tbl); in tce_iommu_take_ownership_ddw()