/kernel/linux/linux-5.10/arch/powerpc/include/asm/ |
D | iommu.h | 27 #define IOMMU_PAGE_SIZE(tblptr) (ASM_CONST(1) << (tblptr)->it_page_shift) 28 #define IOMMU_PAGE_MASK(tblptr) (~((1 << (tblptr)->it_page_shift) - 1)) 109 unsigned long it_page_shift;/* table iommu page size */ member 128 return __ilog2((size - 1) >> tbl->it_page_shift) + 1; in get_iommu_order() 303 (iommu_tce_check_ioba((tbl)->it_page_shift, \ 307 (iommu_tce_check_ioba((tbl)->it_page_shift, \ 310 iommu_tce_check_gpa((tbl)->it_page_shift, (gpa)))
|
/kernel/linux/linux-5.10/arch/powerpc/kernel/ |
D | iommu.c | 239 dma_get_seg_boundary_nr_pages(dev, tbl->it_page_shift), in iommu_range_alloc() 302 ret = entry << tbl->it_page_shift; /* Set the return dma address */ in iommu_alloc() 334 entry = dma_addr >> tbl->it_page_shift; in iommu_free_check() 383 entry = dma_addr >> tbl->it_page_shift; in __iommu_free() 452 if (tbl->it_page_shift < PAGE_SHIFT && slen >= PAGE_SIZE && in ppc_iommu_map_sg() 454 align = PAGE_SHIFT - tbl->it_page_shift; in ppc_iommu_map_sg() 456 mask >> tbl->it_page_shift, align); in ppc_iommu_map_sg() 472 dma_addr = entry << tbl->it_page_shift; in ppc_iommu_map_sg() 698 if ((tbl->it_size << tbl->it_page_shift) >= (1UL * 1024 * 1024 * 1024)) in iommu_init_table() 805 if (tbl->it_page_shift < PAGE_SHIFT && size >= PAGE_SIZE && in iommu_map_page() [all …]
|
D | dma-iommu.c | 103 if (tbl->it_offset > (mask >> tbl->it_page_shift)) { in dma_iommu_dma_supported() 106 mask, tbl->it_offset << tbl->it_page_shift); in dma_iommu_dma_supported() 133 tbl->it_page_shift - 1); in dma_iommu_get_required_mask()
|
/kernel/linux/linux-5.10/drivers/vfio/ |
D | vfio_iommu_spapr_tce.c | 179 unsigned int it_page_shift) in tce_page_is_contained() argument 184 if (mm_iommu_is_devmem(mm, hpa, it_page_shift, &size)) in tce_page_is_contained() 185 return size == (1UL << it_page_shift); in tce_page_is_contained() 193 return page_shift(compound_head(page)) >= it_page_shift; in tce_page_is_contained() 210 unsigned long entry = ioba >> tbl->it_page_shift; in tce_iommu_find_table() 421 tbl->it_page_shift, &hpa, &mem); in tce_iommu_unuse_page_v2() 516 tbl->it_page_shift)) { in tce_iommu_build() 528 __func__, entry << tbl->it_page_shift, in tce_iommu_build() 561 tce, tbl->it_page_shift, &hpa, &mem); in tce_iommu_build_v2() 566 tbl->it_page_shift)) { in tce_iommu_build_v2() [all …]
|
/kernel/linux/linux-5.10/arch/powerpc/kvm/ |
D | book3s_64_vio.c | 135 if ((tbltmp->it_page_shift <= stt->page_shift) && in kvm_spapr_tce_attach_iommu_group() 136 (tbltmp->it_offset << tbltmp->it_page_shift == in kvm_spapr_tce_attach_iommu_group() 138 (tbltmp->it_size << tbltmp->it_page_shift >= in kvm_spapr_tce_attach_iommu_group() 381 long shift = stit->tbl->it_page_shift; in kvmppc_tce_validate() 428 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_clear_tce() 429 unsigned long io_entry = entry << (stt->page_shift - tbl->it_page_shift); in kvmppc_clear_tce() 443 const unsigned long pgsize = 1ULL << tbl->it_page_shift; in kvmppc_tce_iommu_mapped_dec() 486 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_tce_iommu_unmap() 513 mem = mm_iommu_lookup(kvm->mm, ua, 1ULL << tbl->it_page_shift); in kvmppc_tce_iommu_do_map() 518 if (WARN_ON_ONCE(mm_iommu_ua_to_hpa(mem, ua, tbl->it_page_shift, &hpa))) in kvmppc_tce_iommu_do_map() [all …]
|
D | book3s_64_vio_hv.c | 122 long shift = stit->tbl->it_page_shift; in kvmppc_rm_tce_validate() 254 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_rm_clear_tce() 255 unsigned long io_entry = entry << (stt->page_shift - tbl->it_page_shift); in kvmppc_rm_clear_tce() 269 const unsigned long pgsize = 1ULL << tbl->it_page_shift; in kvmppc_rm_tce_iommu_mapped_dec() 316 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_rm_tce_iommu_unmap() 343 mem = mm_iommu_lookup_rm(kvm->mm, ua, 1ULL << tbl->it_page_shift); in kvmppc_rm_tce_iommu_do_map() 347 if (WARN_ON_ONCE_RM(mm_iommu_ua_to_hpa_rm(mem, ua, tbl->it_page_shift, in kvmppc_rm_tce_iommu_do_map() 378 unsigned long subpages = 1ULL << (stt->page_shift - tbl->it_page_shift); in kvmppc_rm_tce_iommu_map()
|
/kernel/linux/linux-5.10/arch/powerpc/platforms/powernv/ |
D | pci-ioda-tce.c | 54 tbl->it_page_shift = page_shift; in pnv_pci_setup_iommu_table() 55 tbl->it_offset = dma_offset >> tbl->it_page_shift; in pnv_pci_setup_iommu_table() 129 u64 rpn = __pa(uaddr) >> tbl->it_page_shift; in pnv_tce_build() 137 ((rpn + i) << tbl->it_page_shift); in pnv_tce_build()
|
D | npu-dma.c | 137 const __u64 start_addr = tbl->it_offset << tbl->it_page_shift; in pnv_npu_set_window() 138 const __u64 win_size = tbl->it_size << tbl->it_page_shift; in pnv_npu_set_window()
|
D | pci-ioda.c | 1540 unsigned int shift = tbl->it_page_shift; in pnv_pci_ioda2_tce_invalidate() 1763 pe->table_group.tce32_start = tbl->it_offset << tbl->it_page_shift; in pnv_pci_ioda1_setup_dma_pe() 1764 pe->table_group.tce32_size = tbl->it_size << tbl->it_page_shift; in pnv_pci_ioda1_setup_dma_pe() 1788 const __u64 start_addr = tbl->it_offset << tbl->it_page_shift; in pnv_pci_ioda2_set_window() 1789 const __u64 win_size = tbl->it_size << tbl->it_page_shift; in pnv_pci_ioda2_set_window() 1930 res_start = pe->phb->ioda.m32_pci_base >> tbl->it_page_shift; in pnv_pci_ioda2_setup_default_config() 1931 res_end = min(window_size, SZ_4G) >> tbl->it_page_shift; in pnv_pci_ioda2_setup_default_config()
|
/kernel/linux/linux-5.10/arch/powerpc/platforms/pasemi/ |
D | iommu.c | 135 iommu_table_iobmap.it_page_shift = IOBMAP_PAGE_SHIFT; in iommu_table_iobmap_setup() 139 0x80000000 >> iommu_table_iobmap.it_page_shift; in iommu_table_iobmap_setup()
|
/kernel/linux/linux-5.10/arch/powerpc/platforms/pseries/ |
D | iommu.c | 211 tbl->it_page_shift, npages, uaddr, in tce_buildmulti_pSeriesLP() 228 tbl->it_page_shift, in tce_buildmulti_pSeriesLP() 518 tbl->it_page_shift = IOMMU_PAGE_SHIFT_4K; in iommu_table_setparms() 521 tbl->it_offset = phb->dma_window_base_cur >> tbl->it_page_shift; in iommu_table_setparms() 532 tbl->it_size = phb->dma_window_size >> tbl->it_page_shift; in iommu_table_setparms() 555 tbl->it_page_shift = IOMMU_PAGE_SHIFT_4K; in iommu_table_setparms_lpar() 559 tbl->it_offset = offset >> tbl->it_page_shift; in iommu_table_setparms_lpar() 560 tbl->it_size = size >> tbl->it_page_shift; in iommu_table_setparms_lpar() 657 unsigned long ioba = (unsigned long) index << tbl->it_page_shift; in tce_exchange_pseries()
|
D | vio.c | 1188 tbl->it_page_shift = IOMMU_PAGE_SHIFT_4K; in vio_build_iommu_table() 1189 tbl->it_size = size >> tbl->it_page_shift; in vio_build_iommu_table() 1191 tbl->it_offset = offset >> tbl->it_page_shift; in vio_build_iommu_table()
|
/kernel/linux/linux-5.10/arch/powerpc/platforms/cell/ |
D | iommu.c | 188 for (i = 0; i < npages; i++, uaddr += (1 << tbl->it_page_shift)) in tce_build_cell() 483 window->table.it_page_shift = IOMMU_PAGE_SHIFT_4K; in cell_iommu_setup_window() 485 (offset >> window->table.it_page_shift) + pte_offset; in cell_iommu_setup_window() 486 window->table.it_size = size >> window->table.it_page_shift; in cell_iommu_setup_window()
|
/kernel/linux/linux-5.10/arch/powerpc/sysdev/ |
D | dart_iommu.c | 340 iommu_table_dart.it_page_shift = IOMMU_PAGE_SHIFT_4K; in iommu_table_dart_setup()
|