On 06.05.2022 10:38, Roger Pau Monné wrote:
> On Mon, Apr 25, 2022 at 10:40:06AM +0200, Jan Beulich wrote:
>> --- a/xen/drivers/passthrough/vtd/iommu.c
>> +++ b/xen/drivers/passthrough/vtd/iommu.c
>> @@ -772,18 +772,21 @@ static int __must_check cf_check iommu_f
>>      struct domain *d, dfn_t dfn, unsigned long page_count,
>>      unsigned int flush_flags)
>>  {
>> -    ASSERT(page_count && !dfn_eq(dfn, INVALID_DFN));
>> -    ASSERT(flush_flags);
>> +    if ( flush_flags & IOMMU_FLUSHF_all )
>> +    {
>> +        dfn = INVALID_DFN;
>> +        page_count = 0;
>> +    }
>> +    else
>> +    {
>> +        ASSERT(page_count && !dfn_eq(dfn, INVALID_DFN));
>> +        ASSERT(flush_flags);
>> +    }
>>  
>>      return iommu_flush_iotlb(d, dfn, flush_flags & IOMMU_FLUSHF_modified,
>>                               page_count);
> 
> In a future patch we could likely move the code in iommu_flush_iotlb
> into iommu_flush_iotlb_pages, seeing as iommu_flush_iotlb_pages is the
> only caller of iommu_flush_iotlb.

And indeed a later patch does so, and an earlier version of the patch
here did say so in a post-commit-message remark.

Jan


Reply via email to