On Tue, Aug 15, 2023 at 03:29:21PM -0300, Jason Gunthorpe wrote: > Well the way it ought to work is that userspace can pass in 0 length > and the kernel will return the correct length > > So maybe this does need resending with this removed: > > *length = min(*length, data_len); That "length" is 0 (copying the value of cmd->data_len), so it should be 0 even having this line? > Also I see clear_user is called wrong, it doesn't return errno. Oh, right. > Please check and repost it ASAP I will update the branch. Probably > needs some doc adjusting too. I think your version should be good. I can update the series for the doc part. Yi can confirm tonight and report in his time zone. And it should be available for you to take tomorrow. > ops = dev_iommu_ops(idev->dev); > if (!ops->hw_info) { > data = ops->hw_info(idev->dev, &data_len, &cmd->out_data_type); It should be: if (ops->hw_info) { Thanks Nic