From: Liu, Yi L yi.l.liu@intel.com Sent: Thursday, December 21, 2023 11:40 PM
From: Nicolin Chen nicolinc@nvidia.com
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 nicolinc@nvidia.com Co-developed-by: Yi Liu yi.l.liu@intel.com Signed-off-by: Yi Liu yi.l.liu@intel.com
overall this look good:
Reviewed-by: Kevin Tian kevin.tian@intel.com
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; + }