Re: [PATCH v4 11/13] iommu/vt-d: Add set_dev_pasid callback for nested domain

Yi Liu
2024-11-06T10:56:36Z

On 2024/11/6 18:45, Baolu Lu wrote:
> On 2024/11/6 17:14, Yi Liu wrote:
>> On 2024/11/6 16:41, Baolu Lu wrote:
>>> On 2024/11/6 16:17, Tian, Kevin wrote:
>>>>> From: Liu, Yi L <yi.l.liu@intel.com>
>>>>> Sent: Monday, November 4, 2024 9:19 PM
>>>>>
>>>>> +
>>>>> +    dev_pasid = domain_add_dev_pasid(domain, dev, pasid);
>>>>> +    if (IS_ERR(dev_pasid))
>>>>> +        return PTR_ERR(dev_pasid);
>>>>> +
>>>>> +    ret = domain_setup_nested(iommu, dmar_domain, dev, pasid, old);
>>>>> +    if (ret)
>>>>> +        goto out_remove_dev_pasid;
>>>>> +
>>>>> +    domain_remove_dev_pasid(old, dev, pasid);
>>>>> +
>>>>
>>>> forgot one thing. Why not required to create a debugfs entry for
>>>> nested dev_pasid?
>>>
>>> This debugfs node is only created for paging domain.
>>
>> I think Kevin got one point. The debugfs is added when paging domain
>> is attached. How about the paging domains that is only used as nested
>> parent domain. We seem to lack a debugfs node for such paging domains.
>
> Are you talking about the nested parent domain? It's also a paging
> domain, hence a debugfs node will be created.

yes, nested parent domains. But as I mentioned, the debugfs node is created
only in the attach point so far. While the nested attach does not attach
the nested parent, it is subjected to the paging_domain_compatible()
check and contributes its pgd to act as SS page table in the pasid entry.
So it's missed though it should be in another patch to add it.

--
Regards,
Yi Liu