diff options
author | Joao Martins <joao.m.martins@oracle.com> | 2023-10-24 16:51:04 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2023-10-24 17:58:44 +0300 |
commit | e04b23c8d4ed977dbab4a4159f9e4d9a878b5c65 (patch) | |
tree | a65f83d7ffc22e319fdb155d14217a781b778552 /drivers/iommu/iommufd/iommufd_test.h | |
parent | f35f22cc760eb2c7034bf53251399685d611e03f (diff) | |
download | linux-e04b23c8d4ed977dbab4a4159f9e4d9a878b5c65.tar.xz |
iommufd/selftest: Expand mock_domain with dev_flags
Expand mock_domain test to be able to manipulate the device capabilities.
This allows testing with mockdev without dirty tracking support advertised
and thus make sure enforce_dirty test does the expected.
To avoid breaking IOMMUFD_TEST UABI replicate the mock_domain struct and
thus add an input dev_flags at the end.
Link: https://lore.kernel.org/r/20231024135109.73787-14-joao.m.martins@oracle.com
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/iommu/iommufd/iommufd_test.h')
-rw-r--r-- | drivers/iommu/iommufd/iommufd_test.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/iommu/iommufd/iommufd_test.h b/drivers/iommu/iommufd/iommufd_test.h index 3f3644375bf1..9817edcd8968 100644 --- a/drivers/iommu/iommufd/iommufd_test.h +++ b/drivers/iommu/iommufd/iommufd_test.h @@ -19,6 +19,7 @@ enum { IOMMU_TEST_OP_SET_TEMP_MEMORY_LIMIT, IOMMU_TEST_OP_MOCK_DOMAIN_REPLACE, IOMMU_TEST_OP_ACCESS_REPLACE_IOAS, + IOMMU_TEST_OP_MOCK_DOMAIN_FLAGS, }; enum { @@ -40,6 +41,10 @@ enum { MOCK_FLAGS_ACCESS_CREATE_NEEDS_PIN_PAGES = 1 << 0, }; +enum { + MOCK_FLAGS_DEVICE_NO_DIRTY = 1 << 0, +}; + struct iommu_test_cmd { __u32 size; __u32 op; @@ -57,6 +62,13 @@ struct iommu_test_cmd { __u32 out_idev_id; } mock_domain; struct { + __u32 out_stdev_id; + __u32 out_hwpt_id; + __u32 out_idev_id; + /* Expand mock_domain to set mock device flags */ + __u32 dev_flags; + } mock_domain_flags; + struct { __u32 pt_id; } mock_domain_replace; struct { |