Re: [PATH v3 2/3] iommu/vt-d: debugfs: Create/remove debugfs file per {device, pasid}

From: Baolu Lu
Date: Thu Sep 28 2023 - 05:17:19 EST


On 2023/9/28 17:02, Liu, Jingqi wrote:
And here,

void intel_iommu_debugfs_create_dev_pasid(struct iommu_domain *domain,
                      struct device *dev, u32 pasid)
{
    sprintf(dir_name, "%x", pasid);
    dev_pasid->debugfs_entry = debugfs_create_dir(dir_name,
            info->debugfs_entry);

    debugfs_create_file("domain_translation_struct", 0444,
                dev_pasid->debugfs_entry, dev_pasid,
                &domain_translation_struct_fops);
}

Thanks.
You mean to add 'debugfs_entry' in below structure.
    struct dev_pasid_info *dev_pasid;
This structure is also allocated per pair of {dev, pasid}.
The debugfs dentry of  {dev, pasid} can be simply obtained from 'dev_pasid_info'.

So the 'dev_pasid_info' can be passed as a parameter of this helper, right ?
Like this:
void intel_iommu_debugfs_create_dev_pasid(struct iommu_domain *domain,
                      struct dev_pasid_info *dev_pasid) ;

Yes.

Best regards,
baolu