Lines Matching refs:ucmd

107 void iommufd_test_syz_conv_iova_id(struct iommufd_ucmd *ucmd,  in iommufd_test_syz_conv_iova_id()  argument
116 ioas = iommufd_get_ioas(ucmd->ictx, ioas_id); in iommufd_test_syz_conv_iova_id()
120 iommufd_put_object(ucmd->ictx, &ioas->obj); in iommufd_test_syz_conv_iova_id()
636 __get_md_pagetable(struct iommufd_ucmd *ucmd, u32 mockpt_id, u32 hwpt_type) in __get_md_pagetable() argument
640 obj = iommufd_get_object(ucmd->ictx, mockpt_id, hwpt_type); in __get_md_pagetable()
647 get_md_pagetable(struct iommufd_ucmd *ucmd, u32 mockpt_id, in get_md_pagetable() argument
652 hwpt = __get_md_pagetable(ucmd, mockpt_id, IOMMUFD_OBJ_HWPT_PAGING); in get_md_pagetable()
657 iommufd_put_object(ucmd->ictx, &hwpt->obj); in get_md_pagetable()
665 get_md_pagetable_nested(struct iommufd_ucmd *ucmd, u32 mockpt_id, in get_md_pagetable_nested() argument
670 hwpt = __get_md_pagetable(ucmd, mockpt_id, IOMMUFD_OBJ_HWPT_NESTED); in get_md_pagetable_nested()
675 iommufd_put_object(ucmd->ictx, &hwpt->obj); in get_md_pagetable_nested()
739 static int iommufd_test_mock_domain(struct iommufd_ucmd *ucmd, in iommufd_test_mock_domain() argument
749 sobj = iommufd_object_alloc(ucmd->ictx, sobj, IOMMUFD_OBJ_SELFTEST); in iommufd_test_mock_domain()
753 sobj->idev.ictx = ucmd->ictx; in iommufd_test_mock_domain()
765 idev = iommufd_device_bind(ucmd->ictx, &sobj->idev.mock_dev->dev, in iommufd_test_mock_domain()
781 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_test_mock_domain()
784 iommufd_object_finalize(ucmd->ictx, &sobj->obj); in iommufd_test_mock_domain()
794 iommufd_object_abort(ucmd->ictx, &sobj->obj); in iommufd_test_mock_domain()
799 static int iommufd_test_mock_domain_replace(struct iommufd_ucmd *ucmd, in iommufd_test_mock_domain_replace() argument
812 iommufd_get_object(ucmd->ictx, device_id, IOMMUFD_OBJ_SELFTEST); in iommufd_test_mock_domain_replace()
827 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_test_mock_domain_replace()
830 iommufd_put_object(ucmd->ictx, dev_obj); in iommufd_test_mock_domain_replace()
835 static int iommufd_test_add_reserved(struct iommufd_ucmd *ucmd, in iommufd_test_add_reserved() argument
842 ioas = iommufd_get_ioas(ucmd->ictx, mockpt_id); in iommufd_test_add_reserved()
848 iommufd_put_object(ucmd->ictx, &ioas->obj); in iommufd_test_add_reserved()
853 static int iommufd_test_md_check_pa(struct iommufd_ucmd *ucmd, in iommufd_test_md_check_pa() argument
867 hwpt = get_md_pagetable(ucmd, mockpt_id, &mock); in iommufd_test_md_check_pa()
903 iommufd_put_object(ucmd->ictx, &hwpt->obj); in iommufd_test_md_check_pa()
908 static int iommufd_test_md_check_refs(struct iommufd_ucmd *ucmd, in iommufd_test_md_check_refs() argument
942 static int iommufd_test_md_check_iotlb(struct iommufd_ucmd *ucmd, in iommufd_test_md_check_iotlb() argument
950 hwpt = get_md_pagetable_nested(ucmd, mockpt_id, &mock_nested); in iommufd_test_md_check_iotlb()
960 iommufd_put_object(ucmd->ictx, &hwpt->obj); in iommufd_test_md_check_iotlb()
1018 static int iommufd_test_access_item_destroy(struct iommufd_ucmd *ucmd, in iommufd_test_access_item_destroy() argument
1095 static int iommufd_test_create_access(struct iommufd_ucmd *ucmd, in iommufd_test_create_access() argument
1098 struct iommu_test_cmd *cmd = ucmd->cmd; in iommufd_test_create_access()
1119 ucmd->ictx, in iommufd_test_create_access()
1132 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_test_create_access()
1149 static int iommufd_test_access_replace_ioas(struct iommufd_ucmd *ucmd, in iommufd_test_access_replace_ioas() argument
1187 static int iommufd_test_access_pages(struct iommufd_ucmd *ucmd, in iommufd_test_access_pages() argument
1192 struct iommu_test_cmd *cmd = ucmd->cmd; in iommufd_test_access_pages()
1264 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_test_access_pages()
1282 static int iommufd_test_access_rw(struct iommufd_ucmd *ucmd, in iommufd_test_access_rw() argument
1287 struct iommu_test_cmd *cmd = ucmd->cmd; in iommufd_test_access_rw()
1341 static int iommufd_test_dirty(struct iommufd_ucmd *ucmd, unsigned int mockpt_id, in iommufd_test_dirty() argument
1347 struct iommu_test_cmd *cmd = ucmd->cmd; in iommufd_test_dirty()
1357 hwpt = get_md_pagetable(ucmd, mockpt_id, &mock); in iommufd_test_dirty()
1399 rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd)); in iommufd_test_dirty()
1403 iommufd_put_object(ucmd->ictx, &hwpt->obj); in iommufd_test_dirty()
1407 static int iommufd_test_trigger_iopf(struct iommufd_ucmd *ucmd, in iommufd_test_trigger_iopf() argument
1413 idev = iommufd_get_device(ucmd, cmd->trigger_iopf.dev_id); in iommufd_test_trigger_iopf()
1427 iommufd_put_object(ucmd->ictx, &idev->obj); in iommufd_test_trigger_iopf()
1445 int iommufd_test(struct iommufd_ucmd *ucmd) in iommufd_test() argument
1447 struct iommu_test_cmd *cmd = ucmd->cmd; in iommufd_test()
1451 return iommufd_test_add_reserved(ucmd, cmd->id, in iommufd_test()
1456 return iommufd_test_mock_domain(ucmd, cmd); in iommufd_test()
1459 ucmd, cmd->id, cmd->mock_domain_replace.pt_id, cmd); in iommufd_test()
1462 ucmd, cmd->id, cmd->check_map.iova, in iommufd_test()
1467 ucmd, u64_to_user_ptr(cmd->check_refs.uptr), in iommufd_test()
1470 return iommufd_test_md_check_iotlb(ucmd, cmd->id, in iommufd_test()
1474 return iommufd_test_create_access(ucmd, cmd->id, in iommufd_test()
1478 ucmd, cmd->id, cmd->access_replace_ioas.ioas_id); in iommufd_test()
1481 ucmd, cmd->id, cmd->access_pages.iova, in iommufd_test()
1487 ucmd, cmd->id, cmd->access_rw.iova, in iommufd_test()
1493 ucmd, cmd->id, cmd->destroy_access_pages.access_pages_id); in iommufd_test()
1502 return iommufd_test_dirty(ucmd, cmd->id, cmd->dirty.iova, in iommufd_test()
1508 return iommufd_test_trigger_iopf(ucmd, cmd); in iommufd_test()