Lines Matching refs:table_group
1439 static long pnv_pci_ioda2_unset_window(struct iommu_table_group *table_group,
1447 tbl = pe->table_group.tables[0]; in pnv_pci_ioda2_release_dma_pe()
1448 rc = pnv_pci_ioda2_unset_window(&pe->table_group, 0); in pnv_pci_ioda2_release_dma_pe()
1453 if (pe->table_group.group) { in pnv_pci_ioda2_release_dma_pe()
1454 iommu_group_put(pe->table_group.group); in pnv_pci_ioda2_release_dma_pe()
1455 BUG_ON(pe->table_group.group); in pnv_pci_ioda2_release_dma_pe()
1538 struct iommu_table_group *table_group, struct pci_bus *bus);
1606 iommu_register_group(&pe->table_group, in pnv_ioda_setup_vf_PE()
1608 pnv_ioda_setup_bus_iommu_group(pe, &pe->table_group, NULL); in pnv_ioda_setup_vf_PE()
1762 set_iommu_table_base(&pdev->dev, pe->table_group.tables[0]); in pnv_pci_ioda_dma_dev_setup()
1886 set_iommu_table_base(&dev->dev, pe->table_group.tables[0]); in pnv_ioda_setup_bus_dma()
1907 struct pnv_ioda_pe *pe = container_of(tgl->table_group, in pnv_pci_p7ioc_tce_invalidate()
1908 struct pnv_ioda_pe, table_group); in pnv_pci_p7ioc_tce_invalidate()
2051 struct pnv_ioda_pe *pe = container_of(tgl->table_group, in pnv_pci_ioda2_tce_invalidate()
2052 struct pnv_ioda_pe, table_group); in pnv_pci_ioda2_tce_invalidate()
2224 iommu_register_group(&pe->table_group, phb->hose->global_number, in pnv_pci_ioda1_setup_dma_pe()
2226 pnv_pci_link_table_and_group(phb->hose->node, 0, tbl, &pe->table_group); in pnv_pci_ioda1_setup_dma_pe()
2277 pe->table_group.tce32_start = tbl->it_offset << tbl->it_page_shift; in pnv_pci_ioda1_setup_dma_pe()
2278 pe->table_group.tce32_size = tbl->it_size << tbl->it_page_shift; in pnv_pci_ioda1_setup_dma_pe()
2290 pnv_pci_unlink_table_and_group(tbl, &pe->table_group); in pnv_pci_ioda1_setup_dma_pe()
2295 static long pnv_pci_ioda2_set_window(struct iommu_table_group *table_group, in pnv_pci_ioda2_set_window() argument
2298 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe, in pnv_pci_ioda2_set_window()
2299 table_group); in pnv_pci_ioda2_set_window()
2328 tbl, &pe->table_group); in pnv_pci_ioda2_set_window()
2362 static long pnv_pci_ioda2_create_table(struct iommu_table_group *table_group, in pnv_pci_ioda2_create_table() argument
2366 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe, in pnv_pci_ioda2_create_table()
2367 table_group); in pnv_pci_ioda2_create_table()
2369 __u64 bus_offset = num ? pe->tce_bypass_base : table_group->tce32_start; in pnv_pci_ioda2_create_table()
2434 rc = pnv_pci_ioda2_create_table(&pe->table_group, 0, PAGE_SHIFT, in pnv_pci_ioda2_setup_default_config()
2451 rc = pnv_pci_ioda2_set_window(&pe->table_group, 0, tbl); in pnv_pci_ioda2_setup_default_config()
2474 static long pnv_pci_ioda2_unset_window(struct iommu_table_group *table_group, in pnv_pci_ioda2_unset_window() argument
2477 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe, in pnv_pci_ioda2_unset_window()
2478 table_group); in pnv_pci_ioda2_unset_window()
2493 pnv_pci_unlink_table_and_group(table_group->tables[num], table_group); in pnv_pci_ioda2_unset_window()
2533 struct iommu_table_group *table_group, in pnv_pci_ioda2_create_table_userspace() argument
2537 long ret = pnv_pci_ioda2_create_table(table_group, in pnv_pci_ioda2_create_table_userspace()
2546 static void pnv_ioda2_take_ownership(struct iommu_table_group *table_group) in pnv_ioda2_take_ownership() argument
2548 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe, in pnv_ioda2_take_ownership()
2549 table_group); in pnv_ioda2_take_ownership()
2551 struct iommu_table *tbl = pe->table_group.tables[0]; in pnv_ioda2_take_ownership()
2554 pnv_pci_ioda2_unset_window(&pe->table_group, 0); in pnv_ioda2_take_ownership()
2562 static void pnv_ioda2_release_ownership(struct iommu_table_group *table_group) in pnv_ioda2_release_ownership() argument
2564 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe, in pnv_ioda2_release_ownership()
2565 table_group); in pnv_ioda2_release_ownership()
2582 struct iommu_table_group *table_group, in pnv_ioda_setup_bus_iommu_group_add_devices() argument
2588 iommu_add_device(table_group, &dev->dev); in pnv_ioda_setup_bus_iommu_group_add_devices()
2592 table_group, dev->subordinate); in pnv_ioda_setup_bus_iommu_group_add_devices()
2597 struct iommu_table_group *table_group, struct pci_bus *bus) in pnv_ioda_setup_bus_iommu_group() argument
2601 iommu_add_device(table_group, &pe->pdev->dev); in pnv_ioda_setup_bus_iommu_group()
2604 pnv_ioda_setup_bus_iommu_group_add_devices(pe, table_group, in pnv_ioda_setup_bus_iommu_group()
2638 struct iommu_table_group *table_group; in pnv_pci_ioda_setup_iommu_api() local
2640 table_group = pnv_try_setup_npu_table_group(pe); in pnv_pci_ioda_setup_iommu_api()
2641 if (!table_group) { in pnv_pci_ioda_setup_iommu_api()
2645 table_group = &pe->table_group; in pnv_pci_ioda_setup_iommu_api()
2646 iommu_register_group(&pe->table_group, in pnv_pci_ioda_setup_iommu_api()
2650 pnv_ioda_setup_bus_iommu_group(pe, table_group, in pnv_pci_ioda_setup_iommu_api()
2674 pe->table_group.pgsizes = pgsizes; in pnv_pci_ioda_setup_iommu_api()
2727 pe->table_group.tce32_start = 0; in pnv_pci_ioda2_setup_dma_pe()
2728 pe->table_group.tce32_size = phb->ioda.m32_pci_base; in pnv_pci_ioda2_setup_dma_pe()
2729 pe->table_group.max_dynamic_windows_supported = in pnv_pci_ioda2_setup_dma_pe()
2731 pe->table_group.max_levels = POWERNV_IOMMU_MAX_LEVELS; in pnv_pci_ioda2_setup_dma_pe()
2732 pe->table_group.pgsizes = pnv_ioda_parse_tce_sizes(phb); in pnv_pci_ioda2_setup_dma_pe()
2734 pe->table_group.ops = &pnv_pci_ioda2_ops; in pnv_pci_ioda2_setup_dma_pe()
3419 static long pnv_pci_ioda1_unset_window(struct iommu_table_group *table_group, in pnv_pci_ioda1_unset_window() argument
3422 struct pnv_ioda_pe *pe = container_of(table_group, in pnv_pci_ioda1_unset_window()
3423 struct pnv_ioda_pe, table_group); in pnv_pci_ioda1_unset_window()
3444 pnv_pci_unlink_table_and_group(table_group->tables[num], table_group); in pnv_pci_ioda1_unset_window()
3451 struct iommu_table *tbl = pe->table_group.tables[0]; in pnv_pci_ioda1_release_pe_dma()
3457 rc = pnv_pci_ioda1_unset_window(&pe->table_group, 0); in pnv_pci_ioda1_release_pe_dma()
3462 if (pe->table_group.group) { in pnv_pci_ioda1_release_pe_dma()
3463 iommu_group_put(pe->table_group.group); in pnv_pci_ioda1_release_pe_dma()
3464 WARN_ON(pe->table_group.group); in pnv_pci_ioda1_release_pe_dma()
3473 struct iommu_table *tbl = pe->table_group.tables[0]; in pnv_pci_ioda2_release_pe_dma()
3483 rc = pnv_pci_ioda2_unset_window(&pe->table_group, 0); in pnv_pci_ioda2_release_pe_dma()
3489 if (pe->table_group.group) { in pnv_pci_ioda2_release_pe_dma()
3490 iommu_group_put(pe->table_group.group); in pnv_pci_ioda2_release_pe_dma()
3491 WARN_ON(pe->table_group.group); in pnv_pci_ioda2_release_pe_dma()