lkml.org 
[lkml]   [2024]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH rc 7/8] iommu/vt-d: Wrap the dirty tracking loop to be a helper
On 2024/2/8 16:23, Yi Liu wrote:
> --- a/drivers/iommu/intel/iommu.c
> +++ b/drivers/iommu/intel/iommu.c
> @@ -4730,23 +4730,35 @@ static void *intel_iommu_hw_info(struct device *dev, u32 *length, u32 *type)
> return vtd;
> }
>
> +static int
> +device_set_dirty_tracking(struct list_head *devices, bool enable)
> +{
> + struct device_domain_info *info;
> + int ret = 0;
> +
> + list_for_each_entry(info, devices, link) {
> + ret = intel_pasid_setup_dirty_tracking(info->iommu, info->dev,
> + IOMMU_NO_PASID, enable);
> + if (ret)
> + break;
> + }
> +
> + return ret;
> +}

Let's make this helper specific. Something like below.

/*
* Set dirty tracking for the device list of a domain. The caller must
* hold the domain->lock when calling it.
*/
static int device_list_set_dirty_tracking(...)

Best regards,
baolu

\
 
 \ /
  Last update: 2024-05-27 14:55    [W:0.199 / U:1.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site