>-----Original Message-----
>From: Liu, Yi L <yi.l....@intel.com>
>Subject: Re: [PATCH v3 05/17] intel_iommu: Rename slpte to pte
>
>On 2024/9/11 13:22, Zhenzhong Duan wrote:
>> From: Yi Liu <yi.l....@intel.com>
...
>> @@ -1918,13 +1919,13 @@ static bool
>vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus,
>>
>>       cc_entry = &vtd_as->context_cache_entry;
>>
>> -    /* Try to fetch slpte form IOTLB, we don't need RID2PASID logic */
>> +    /* Try to fetch pte form IOTLB, we don't need RID2PASID logic */
>
>s/form/from/

Will fix.

>
>>       if (!rid2pasid) {
>>           iotlb_entry = vtd_lookup_iotlb(s, source_id, pasid, addr);
>>           if (iotlb_entry) {
>> -            trace_vtd_iotlb_page_hit(source_id, addr, iotlb_entry->slpte,
>> +            trace_vtd_iotlb_page_hit(source_id, addr, iotlb_entry->pte,
>>                                        iotlb_entry->domain_id);
>> -            slpte = iotlb_entry->slpte;
>> +            pte = iotlb_entry->pte;
>>               access_flags = iotlb_entry->access_flags;
>>               page_mask = iotlb_entry->mask;
>>               goto out;
>> @@ -1996,20 +1997,20 @@ static bool
>vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus,
>>           return true;
>>       }
>>
>> -    /* Try to fetch slpte form IOTLB for RID2PASID slow path */
>> +    /* Try to fetch pte form IOTLB for RID2PASID slow path */
>
>s/form/from/. otherwise, looks good to me.

Will fix.

Thanks
Zhenzhong

>
>Reviewed-by: Yi Liu <yi.l....@intel.com>
>
>>       if (rid2pasid) {
>>           iotlb_entry = vtd_lookup_iotlb(s, source_id, pasid, addr);
>>           if (iotlb_entry) {
>> -            trace_vtd_iotlb_page_hit(source_id, addr, iotlb_entry->slpte,
>> +            trace_vtd_iotlb_page_hit(source_id, addr, iotlb_entry->pte,
>>                                        iotlb_entry->domain_id);
>> -            slpte = iotlb_entry->slpte;
>> +            pte = iotlb_entry->pte;
>>               access_flags = iotlb_entry->access_flags;
>>               page_mask = iotlb_entry->mask;
>>               goto out;
>>           }
>>       }
>>
>> -    ret_fr = vtd_iova_to_slpte(s, &ce, addr, is_write, &slpte, &level,
>> +    ret_fr = vtd_iova_to_slpte(s, &ce, addr, is_write, &pte, &level,
>>                                  &reads, &writes, s->aw_bits, pasid);
>>       if (ret_fr) {
>>           vtd_report_fault(s, -ret_fr, is_fpd_set, source_id,
>> @@ -2017,14 +2018,14 @@ static bool
>vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus,
>>           goto error;
>>       }
>>
>> -    page_mask = vtd_slpt_level_page_mask(level);
>> +    page_mask = vtd_pt_level_page_mask(level);
>>       access_flags = IOMMU_ACCESS_FLAG(reads, writes);
>>       vtd_update_iotlb(s, source_id, vtd_get_domain_id(s, &ce, pasid),
>> -                     addr, slpte, access_flags, level, pasid);
>> +                     addr, pte, access_flags, level, pasid);
>>   out:
>>       vtd_iommu_unlock(s);
>>       entry->iova = addr & page_mask;
>> -    entry->translated_addr = vtd_get_slpte_addr(slpte, s->aw_bits) &
>page_mask;
>> +    entry->translated_addr = vtd_get_pte_addr(pte, s->aw_bits) &
>page_mask;
>>       entry->addr_mask = ~page_mask;
>>       entry->perm = access_flags;
>>       return true;
>
>--
>Regards,
>Yi Liu

Reply via email to