Lines Matching refs:iommu
64 amd_iommu_get_src_bdf(amd_iommu_t *iommu, int32_t bdf, int32_t *src_bdfp)
87 amd_iommu_get_domain(amd_iommu_t *iommu, dev_info_t *rdip, int alias,
124 amd_iommu_init_page_tables(amd_iommu_t *iommu)
132 amd_iommu_fini_page_tables(amd_iommu_t *iommu)
142 amd_iommu_lookup_domain(amd_iommu_t *iommu, domain_id_t domainid,
170 iommu->aiomt_idx, domainid);
196 amd_iommu_teardown_domain(amd_iommu_t *iommu, amd_iommu_domain_t *dp)
228 if (amd_iommu_cmd(iommu, AMD_IOMMU_CMD_INVAL_IOMMU_PAGES,
232 f, iommu->aiomt_idx, cmdargs.ca_domainid);
237 amd_iommu_get_deviceid(amd_iommu_t *iommu, dev_info_t *rdip, int32_t *deviceid,
245 dev_info_t *idip = iommu->aiomt_dip;
257 if (amd_iommu_get_src_bdf(iommu, -1, &src_bdf) != DDI_SUCCESS) {
261 f, driver, instance, iommu->aiomt_idx);
278 f, driver, instance, iommu->aiomt_idx, (void *)rdip,
287 f, driver, instance, iommu->aiomt_idx,
299 iommu->aiomt_idx,
307 if (amd_iommu_get_src_bdf(iommu, bdf, &src_bdf) != DDI_SUCCESS) {
310 f, driver, instance, iommu->aiomt_idx, (void *)pci_dip,
328 init_devtbl(amd_iommu_t *iommu, uint64_t *devtbl_entry, domain_id_t domainid,
387 amd_iommu_set_passthru(amd_iommu_t *iommu, dev_info_t *rdip)
421 if (amd_iommu_get_deviceid(iommu, rdip, &deviceid, &alias, path)
426 iommu->aiomt_idx, (void *)rdip, path);
436 iommu->aiomt_devtbl_sz) {
440 instance, iommu->aiomt_idx, deviceid, (void *)rdip,
441 iommu->aiomt_devtbl_sz, path);
446 devtbl_entry = (uint64_t *)&iommu->aiomt_devtbl
470 (void) amd_iommu_cmd(iommu, AMD_IOMMU_CMD_INVAL_DEVTAB_ENTRY,
479 amd_iommu_set_devtbl_entry(amd_iommu_t *iommu, dev_info_t *rdip,
486 dev_info_t *idip = iommu->aiomt_dip;
497 iommu->aiomt_devtbl_sz) {
501 instance, iommu->aiomt_idx, deviceid, (void *)rdip,
502 iommu->aiomt_devtbl_sz, path);
507 devtbl_entry = (uint64_t *)&iommu->aiomt_devtbl
520 error = amd_iommu_cmd(iommu, AMD_IOMMU_CMD_INVAL_DEVTAB_ENTRY,
525 f, iommu->aiomt_idx, deviceid);
534 error = amd_iommu_cmd(iommu, AMD_IOMMU_CMD_INVAL_IOMMU_PAGES,
539 f, iommu->aiomt_idx, cmdargs.ca_domainid);
544 if (init_devtbl(iommu, devtbl_entry, domainid, dp)) {
546 error = amd_iommu_cmd(iommu, AMD_IOMMU_CMD_INVAL_DEVTAB_ENTRY,
554 amd_iommu_clear_devtbl_entry(amd_iommu_t *iommu, dev_info_t *rdip,
561 const char *driver = ddi_driver_name(iommu->aiomt_dip);
562 int instance = ddi_get_instance(iommu->aiomt_dip);
572 iommu->aiomt_devtbl_sz) {
576 iommu->aiomt_idx, deviceid, (void *)rdip,
577 iommu->aiomt_devtbl_sz, path);
582 devtbl_entry = (uint64_t *)&iommu->aiomt_devtbl
605 SYNC_FORDEV(iommu->aiomt_dmahdl);
615 error = amd_iommu_cmd(iommu, AMD_IOMMU_CMD_INVAL_DEVTAB_ENTRY,
712 amd_iommu_lookup_pgtable(amd_iommu_t *iommu, amd_iommu_page_table_t *ppt,
769 amd_iommu_alloc_pgtable(amd_iommu_t *iommu, domain_id_t domainid,
775 dev_info_t *idip = iommu->aiomt_dip;
923 amd_iommu_free_pgtable(amd_iommu_t *iommu, amd_iommu_page_table_t *pt)
927 dev_info_t *dip = iommu->aiomt_dip;
950 f, driver, instance, iommu->aiomt_idx, pt->pt_domainid,
1091 amd_iommu_setup_1_pgtable(amd_iommu_t *iommu, dev_info_t *rdip,
1120 if (pt = amd_iommu_lookup_pgtable(iommu, ppt, dp, level, index)) {
1127 if ((error = amd_iommu_alloc_pgtable(iommu, domainid, path, &pt,
1130 "path = %s", f, driver, instance, iommu->aiomt_idx,
1162 amd_iommu_teardown_pdte(amd_iommu_t *iommu,
1201 amd_iommu_free_pgtable(iommu, pt);
1209 amd_iommu_create_pgtables(amd_iommu_t *iommu, dev_info_t *rdip,
1228 iommu->aiomt_idx, domainid, deviceid,
1242 if ((error = amd_iommu_setup_1_pgtable(iommu, rdip, dmareq,
1248 f, driver, instance, iommu->aiomt_idx,
1269 if ((error = amd_iommu_set_devtbl_entry(iommu, rdip, domainid, deviceid,
1275 iommu->aiomt_idx, (void *)rdip, deviceid, domainid, path);
1279 SYNC_FORDEV(iommu->aiomt_dmahdl);
1285 amd_iommu_destroy_pgtables(amd_iommu_t *iommu, dev_info_t *rdip,
1301 const char *driver = ddi_driver_name(iommu->aiomt_dip);
1302 int instance = ddi_get_instance(iommu->aiomt_dip);
1309 iommu->aiomt_idx, domainid, deviceid,
1325 pt = amd_iommu_lookup_pgtable(iommu, ppt, dp, level, index);
1356 retval = amd_iommu_teardown_pdte(iommu, pt, index);
1392 if (amd_iommu_cmd(iommu, AMD_IOMMU_CMD_INVAL_IOMMU_PAGES,
1397 iommu->aiomt_idx, domainid, (void *)rdip, path);
1405 error = amd_iommu_clear_devtbl_entry(iommu, rdip, domainid,
1412 SYNC_FORDEV(iommu->aiomt_dmahdl);
1434 amd_iommu_map_pa2va(amd_iommu_t *iommu, dev_info_t *rdip, ddi_dma_attr_t *attrp,
1454 const char *driver = ddi_driver_name(iommu->aiomt_dip);
1455 int instance = ddi_get_instance(iommu->aiomt_dip);
1474 if (amd_iommu_get_deviceid(iommu, rdip, &deviceid, &alias, path)
1478 iommu->aiomt_idx, (void *)rdip, path);
1486 if (amd_iommu_get_domain(iommu, rdip, alias, deviceid, &domainid, path)
1490 iommu->aiomt_idx, (void *)rdip, path);
1495 dp = amd_iommu_lookup_domain(iommu, domainid, type, km_flags);
1499 iommu->aiomt_idx, domainid, (void *)rdip, path);
1563 if ((error = amd_iommu_create_pgtables(iommu, rdip, dmareq,
1595 amd_iommu_unmap_va(amd_iommu_t *iommu, dev_info_t *rdip, uint64_t start_va,
1611 const char *driver = ddi_driver_name(iommu->aiomt_dip);
1612 int instance = ddi_get_instance(iommu->aiomt_dip);
1630 if (amd_iommu_get_deviceid(iommu, rdip, &deviceid, &alias, path)
1634 iommu->aiomt_idx, (void *)rdip, path);
1642 if (amd_iommu_get_domain(iommu, rdip, alias, deviceid, &domainid, path)
1646 iommu->aiomt_idx, (void *)rdip, path);
1652 dp = amd_iommu_lookup_domain(iommu, domainid, AMD_IOMMU_INVALID_MAP,
1657 iommu->aiomt_idx, domainid, (void *)rdip, path);
1672 if (amd_iommu_destroy_pgtables(iommu, rdip,
1693 amd_iommu_teardown_domain(iommu, dp);