lkml.org 
[lkml]   [2023]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 3/4] iommufd: Add IOMMU_GET_HW_INFO
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

\
 
 \ /
  Last update: 2023-08-15 20:57    [W:0.097 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site