[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9f311322-8340-c0ae-a500-ad9926ceea58@intel.com>
Date: Thu, 12 Oct 2023 17:13:59 +0800
From: Yi Liu <yi.l.liu@...el.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: <joro@...tes.org>, <alex.williamson@...hat.com>,
<kevin.tian@...el.com>, <robin.murphy@....com>,
<baolu.lu@...ux.intel.com>, <cohuck@...hat.com>,
<eric.auger@...hat.com>, <nicolinc@...dia.com>,
<kvm@...r.kernel.org>, <mjrosato@...ux.ibm.com>,
<chao.p.peng@...ux.intel.com>, <yi.y.sun@...ux.intel.com>,
<peterx@...hat.com>, <jasowang@...hat.com>,
<shameerali.kolothum.thodi@...wei.com>, <lulu@...hat.com>,
<suravee.suthikulpanit@....com>, <iommu@...ts.linux.dev>,
<linux-kernel@...r.kernel.org>, <linux-kselftest@...r.kernel.org>,
<zhenzhong.duan@...el.com>, <joao.m.martins@...cle.com>
Subject: Re: [PATCH v4 02/17] iommu: Add nested domain support
On 2023/10/11 01:21, Jason Gunthorpe wrote:
> On Thu, Sep 21, 2023 at 12:51:23AM -0700, Yi Liu wrote:
>> From: Lu Baolu <baolu.lu@...ux.intel.com>
>>
>> Introduce a new domain type for a user I/O page table, which is nested on
>> top of another user space address represented by a UNMANAGED
>> domain. The
>
> Lets start using the world PAGING whenever you want to type
> UNMANAGED. I'm trying to get rid of UNMANAGED.
sure.
>> @@ -241,6 +245,21 @@ struct iommu_user_data {
>> size_t len;
>> };
>>
>> +/**
>> + * struct iommu_user_data_array - iommu driver specific user space data array
>> + * @uptr: Pointer to the user buffer array for copy_from_user()
>> + * @entry_len: The fixed-width length of a entry in the array, in bytes
>> + * @entry_num: The number of total entries in the array
>> + *
>> + * A array having a @entry_num number of @entry_len sized entries, each entry is
>> + * user space data, i.e. an uAPI that is defined in include/uapi/linux/iommufd.h
>> + */
>> +struct iommu_user_data_array {
>> + void __user *uptr;
>> + size_t entry_len;
>> + int entry_num;
>> +};
>
> Ditto about iommu-driver.h for most of this stuff
ack.
>> +
>> /**
>> * 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
>> @@ -263,6 +282,34 @@ static inline int iommu_copy_user_data(void *dst_data,
>> src_data->uptr, src_data->len);
>> }
>>
>> +/**
>> + * iommu_copy_user_data_from_array - Copy iommu driver specific user space data
>> + * from an iommu_user_data_array input
>> + * @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_array for user space data array
>> + * @index: Index to offset the location in the array to copy user data from
>> + * @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_from_array(void *dst_data,
>> + const struct iommu_user_data_array *src_array,
>> + int index, size_t data_len, size_t min_len)
>
> Index should be 'unsigned int'
yes.
--
Regards,
Yi Liu
Powered by blists - more mailing lists