Skip to content

Commit a8c9df2

Browse files
nicolincjgunthorpe
authored andcommitted
iommufd/selftest: Cover IOMMU_FAULT_QUEUE_ALLOC in iommufd_fail_nth
This was missing in the series introducing the fault object. Thus, add it. Link: https://patch.msgid.link/r/d61b9b7f73276cc8f1aef9602bd35c486917506e.1733212723.git.nicolinc@nvidia.com Signed-off-by: Nicolin Chen <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent af7f478 commit a8c9df2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tools/testing/selftests/iommu/iommufd_fail_nth.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,12 @@ TEST_FAIL_NTH(basic_fail_nth, access_pin_domain)
615615
/* device.c */
616616
TEST_FAIL_NTH(basic_fail_nth, device)
617617
{
618+
struct iommu_hwpt_selftest data = {
619+
.iotlb = IOMMU_TEST_IOTLB_DEFAULT,
620+
};
618621
struct iommu_test_hw_info info;
622+
uint32_t fault_id, fault_fd;
623+
uint32_t fault_hwpt_id;
619624
uint32_t ioas_id;
620625
uint32_t ioas_id2;
621626
uint32_t stdev_id;
@@ -678,6 +683,15 @@ TEST_FAIL_NTH(basic_fail_nth, device)
678683
if (_test_cmd_vdevice_alloc(self->fd, viommu_id, idev_id, 0, &vdev_id))
679684
return -1;
680685

686+
if (_test_ioctl_fault_alloc(self->fd, &fault_id, &fault_fd))
687+
return -1;
688+
close(fault_fd);
689+
690+
if (_test_cmd_hwpt_alloc(self->fd, idev_id, hwpt_id, fault_id,
691+
IOMMU_HWPT_FAULT_ID_VALID, &fault_hwpt_id,
692+
IOMMU_HWPT_DATA_SELFTEST, &data, sizeof(data)))
693+
return -1;
694+
681695
return 0;
682696
}
683697

0 commit comments

Comments
 (0)