[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b09f96db-8451-4de9-81c5-312cffdfd4fc@linux.intel.com>
Date: Mon, 20 May 2024 10:18:49 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: "Tian, Kevin" <kevin.tian@...el.com>, Jason Gunthorpe <jgg@...pe.ca>,
Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
Nicolin Chen <nicolinc@...dia.com>, "Liu, Yi L" <yi.l.liu@...el.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
Joel Granados <j.granados@...sung.com>
Cc: baolu.lu@...ux.intel.com, "iommu@...ts.linux.dev"
<iommu@...ts.linux.dev>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 7/9] iommufd: Associate fault object with
iommufd_hw_pgtable
On 5/15/24 4:50 PM, Tian, Kevin wrote:
>> From: Lu Baolu <baolu.lu@...ux.intel.com>
>> Sent: Tuesday, April 30, 2024 10:57 PM
>>
>> @@ -227,7 +233,7 @@ iommufd_hwpt_nested_alloc(struct iommufd_ctx
>> *ictx,
>> refcount_inc(&parent->common.obj.users);
>> hwpt_nested->parent = parent;
>>
>> - hwpt->domain = ops->domain_alloc_user(idev->dev, flags,
>> + hwpt->domain = ops->domain_alloc_user(idev->dev, 0,
>> parent->common.domain,
>> user_data);
>
> it reads slightly better to clear the fault bit and still pass in flags.
>
Done.
- hwpt->domain = ops->domain_alloc_user(idev->dev, 0,
+ hwpt->domain = ops->domain_alloc_user(idev->dev,
+ flags &
~IOMMU_HWPT_FAULT_ID_VALID,
parent->common.domain,
user_data);
>> @@ -308,6 +314,19 @@ int iommufd_hwpt_alloc(struct iommufd_ucmd
>> *ucmd)
>> goto out_put_pt;
>> }
>>
>> + if (cmd->flags & IOMMU_HWPT_FAULT_ID_VALID) {
>> + struct iommufd_fault *fault;
>> +
>> + fault = iommufd_get_fault(ucmd, cmd->fault_id);
>> + if (IS_ERR(fault)) {
>> + rc = PTR_ERR(fault);
>> + goto out_hwpt;
>> + }
>> + hwpt->fault = fault;
>> + hwpt->domain->iopf_handler = iommufd_fault_iopf_handler;
>> + hwpt->domain->fault_data = hwpt;
>> + }
>
> this is nesting specific. why not moving it to the nested_alloc()?
Nesting is currently a use case for userspace I/O page faults, but this
design should be general enough to support other scenarios as well.
Best regards,
baolu
Powered by blists - more mailing lists