lkml.org 
[lkml]   [2023]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v8 4/5] iommufd/selftest: Add coverage for IOMMU_GET_HW_INFO ioctl
Date
> From: Liu, Yi L <yi.l.liu@intel.com>
> Sent: Wednesday, August 16, 2023 8:14 PM
>
>
> +TEST_F(iommufd_ioas, get_hw_info)
> +{
> + struct iommu_test_hw_info buffer_exact;
> + struct iommu_test_hw_info_buffer {
> + struct iommu_test_hw_info info;
> + uint64_t trailing_bytes;
> + } buffer_larger;
> +
> + if (self->device_id) {
> + /* Provide a zero-size user_buffer */
> + test_cmd_get_hw_info(self->device_id, NULL, 0);
> + /* Provide a user_buffer with exact size */
> + test_cmd_get_hw_info(self->device_id, &buffer_exact,
> sizeof(buffer_exact));
> + /*
> + * Provide a user_buffer with size larger than the exact size to
> check if
> + * kernel zero the trailing bytes.
> + */
> + test_cmd_get_hw_info(self->device_id, &buffer_larger,
> sizeof(buffer_larger));

Do we also want to test a case where size is smaller than the exact size?

\
 
 \ /
  Last update: 2023-08-17 09:35    [W:0.171 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site