> From: Liu, Yi L <[email protected]>
> Sent: Thursday, December 21, 2023 11:40 PM
> 
> From: Nicolin Chen <[email protected]>
> 
> Add test cases for the IOMMU_HWPT_INVALIDATE ioctl and verify it by using
> the new IOMMU_TEST_OP_MD_CHECK_IOTLB.
> 
> Signed-off-by: Nicolin Chen <[email protected]>
> Co-developed-by: Yi Liu <[email protected]>
> Signed-off-by: Yi Liu <[email protected]>

overall this look good:

Reviewed-by: Kevin Tian <[email protected]>

with two  nits:

> +
> +             num_inv = 1;
> +             inv_reqs[0].flags = IOMMU_TEST_INVALIDATE_FLAG_ALL |
> +
> IOMMU_TEST_INVALIDATE_FLAG_TRIGGER_ERROR;
> +             test_err_hwpt_invalidate(EINVAL, nested_hwpt_id[0],
> inv_reqs,
> +
> IOMMU_HWPT_INVALIDATE_DATA_SELFTEST,
> +                                      sizeof(*inv_reqs), &num_inv);
> +             assert(!num_inv);

this may need adjustment upon whether we want to allow two flags together.

and let's add a test for below code for completeness:

+       if (cmd->req_num && (!cmd->reqs_uptr || !cmd->req_len)) {
+               rc = -EINVAL;
+               goto out;
+       }

Reply via email to