[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 12/21] IOMMU: fold flush-all hook into "flush one"


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 6 May 2022 11:59:38 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iMvuZ7/xlozp6ZJdbEAzUbBzJf9NxYJWRlrX/bBoddE=; b=Kdr4cVAN70ijhNkQty3yr5udnnda2YupBD6LqbyW1j6mM2HTua5a5JFGcrsi322rOhTRvExnx7IWGYEaKHSg0rMxzbYRTFSkDdxrWucn2p+NrTce4SQyB1LaCX8JeVEFfmEbVFWUTgZRGvtfgqBhec/6mjnHJNcdKfCkrlgFNMv2Dfw/taTnqUI7myDepwES6EMDj3kACCD4HLO298ojTaIuSmpgDRTP2smD1uHYDoSrkBcfetS+kVOGZFS4em0g6iME4BFpyAoZZuitSd75T7Vm9gOV3PvP9ME4GYL9jVG/M9PvePcuI2IkQspOcQtRLVWEJ4JnYd71ZRf+wxzOpw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JkumnEpyo+bGYCA1eZRSkFJA+5DKWt7gDZomGVi+m9Vqp93DvK9mypCwX0UDS7WZfIcYBo/V30ECcxVm34QEBW9Dsw2iKgng8XR/reY8AUA72i/FvBGrxENLuk+xTNdXrLNEfMhC11d0XQbLqAHH2XMqeTr7k668AWh3sMAQi+cv/VKQYzLLQKlFkaI/U3JFd9F6ebeofI+eMrtcpieseWZQvDn3T6ER50ignjrBwavvEw6ptR5S/Nh6hTuwo57vGm9sVWowek259HRMVQo7mS/9p/u2FptOHlSump5uPRMa4Gsu83LmVHxaeEk3qlvnaPeD08XalnKAGjriGHrGow==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Fri, 06 May 2022 09:59:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.