>-----Original Message-----
>From: Clément MATHIEU--DRIF <[email protected]>
>Subject: Re: [PATCH v6 4/6] intel_iommu_accel: Add PRQ injection for 
>passthrough
>device
...

>> --- a/hw/i386/intel_iommu_accel.c
>> +++ b/hw/i386/intel_iommu_accel.c
>> @@ -9,6 +9,7 @@
>>   */
>>
>>  #include "qemu/osdep.h"
>> +#include "qemu/error-report.h"
>>  #include "system/iommufd.h"
>>  #include "intel_iommu_internal.h"
>>  #include "intel_iommu_accel.h"
>> @@ -77,14 +78,140 @@ VTDHostIOMMUDevice
>*vtd_find_hiod_iommufd(VTDAddressSpace *as)
>>      return NULL;
>>  }
>>
>> -static bool vtd_create_fs_hwpt(VTDHostIOMMUDevice *vtd_hiod,
>> -                               VTDPASIDEntry *pe, uint32_t *fs_hwpt_id,
>> -                               Error **errp)
>> +static void vtd_propagate_recoverable_fault(VTDAccelPASIDCacheEntry
>*vtd_pce,
>> +                                            struct iommu_hwpt_pgfault 
>> *fault,
>> +                                            unsigned cnt)
>
>Why not a trailing "s" to vtd_propagate_recoverable_fault?

Sure, will do.

>
>> +{
>> +    VTDHostIOMMUDevice *vtd_hiod = vtd_pce->vtd_hiod;
>> +    uint32_t pasid =
>> +        vtd_pce->pasid == IOMMU_NO_PASID ? PCI_NO_PASID : vtd_pce->pasid;
>> +
>> +    for (; cnt--; fault++) {
>> +        bool last_page = fault->flags & IOMMU_PGFAULT_FLAGS_LAST_PAGE;
>> +
>> +        vtd_pri_request_page(vtd_hiod->bus, vtd_hiod->iommu_state,
>> +                             vtd_hiod->devfn, pasid,
>> +                             fault->perm & IOMMU_PGFAULT_PERM_PRIV,
>> +                             fault->perm & IOMMU_PGFAULT_PERM_EXEC,
>> +                             fault->addr, last_page, fault->grpid,
>> +                             fault->perm & IOMMU_PGFAULT_PERM_READ,
>> +                             fault->perm & IOMMU_PGFAULT_PERM_WRITE);
>> +    }
>> +}
>> +
>> +/* Batch size per read(); remaining faults trigger another callback */
>> +#define FAULTQ_BUF_SIZE 2048
>> +
>> +static void vtd_read_fs_faultq(void *opaque)
>> +{
>> +    VTDAccelPASIDCacheEntry *vtd_pce = opaque;
>> +    struct iommu_hwpt_pgfault fault[FAULTQ_BUF_SIZE];
>
>s/fault/faults/

Will do.

Thanks
Zhenzhong

Reply via email to