RE: [PATCH v8 4/5] iommufd/selftest: Add coverage for IOMMU_GET_HW_INFO ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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?




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux