> From: Liu, Yi L <yi.l.liu@xxxxxxxxx> > 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?