Re: [PATCH v3 19/19] iommu/intel: Access/Dirty bit support for SL domains

Baolu Lu
2023-10-16T12:42:39Z

On 2023/10/16 18:42, Joao Martins wrote:
>>> +        domain->dirty_ops = &intel_dirty_ops;
>>>       return domain;
>>>   }
>> The VT-d driver always uses second level for a user domain translation.
>> In order to avoid checks of "domain->use_first_level" in the callbacks,
>> how about check it here and return failure if first level is used for
>> user domain?
>>
> I was told by Yi Y Sun offlist to have the first_level checked, because dirty
> bit in first stage page table is always enabled (and cannot be toggled on/off).
> I can remove it again; initially RFC didn't have it as it was failing in similar
> way to how you suggest here. Not sure how to proceed?

Yi was right. But we currently have no use case for dirty tracking in
the first-level page table. So let's start from only supporting it in
the second level page table.

If we later identify a use case for dirty tracking in the first level
page table, we can then add the code with appropriate testing efforts.

Best regards,
baolu