lkml.org 
[lkml]   [2023]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v4 01/17] iommu: Add hwpt_type with user_data for domain_alloc_user op
    On Fri, Oct 13, 2023 at 07:42:50PM +0800, Yi Liu wrote:
    > On 2023/10/12 17:12, Yi Liu wrote:
    > > On 2023/9/26 14:56, Tian, Kevin wrote:
    > > > > From: Yi Liu <yi.l.liu@intel.com>
    > > > > Sent: Thursday, September 21, 2023 3:51 PM
    > > > > +
    > > > > +/**
    > > > > + * iommu_copy_user_data - Copy iommu driver specific user space data
    > > > > + * @dst_data: Pointer to an iommu driver specific user data that is
    > > > > defined
    > > > > in
    > > > > + * include/uapi/linux/iommufd.h
    > > > > + * @src_data: Pointer to a struct iommu_user_data for user space data info
    > > > > + * @data_len: Length of current user data structure, i.e. sizeof(struct
    > > > > _dst)
    > > > > + * @min_len: Initial length of user data structure for backward
    > > > > compatibility.
    > > > > + * This should be offsetofend using the last member in the
    > > > > user data
    > > > > + * struct that was initially added to
    > > > > include/uapi/linux/iommufd.h
    > > > > + */
    > > > > +static inline int iommu_copy_user_data(void *dst_data,
    > > > > + const struct iommu_user_data *src_data,
    > > > > + size_t data_len, size_t min_len)
    > > >
    > > > iommu_copy_struct_from_user()?
    > > >
    > > > btw given the confusion raised on how this would be used is it clearer
    > > > to move it to the patch together with the 1st user?
    > >
    > > sure. How about your opinion? @Nic.
    > >
    >
    > after a second thinking, the first user of this helper is the patch to
    > extend mock iommu driver. Is it suitable to introduce a common API together
    > with selftest code?
    >
    > https://lore.kernel.org/linux-iommu/20230921075138.124099-14-yi.l.liu@intel.com/

    I feel no...

    But I could separate iommu_copy_struct_from_user and its array
    drivitive into an additional patch placed before the selftest
    changes, so at least it would be closer to the first callers.

    Thanks
    Nic

    \
     
     \ /
      Last update: 2023-10-14 00:23    [W:3.298 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site