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

Re: [PATCH v4 04/21] IOMMU: have iommu_{,un}map() split requests into largest possible chunks


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 3 May 2022 16:44:45 +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=XWmtKpqqxSlmL45fiyRgFSSmbCkQN2t/lZ1ysSR9HDk=; b=SvBE0TAkWNO0f7p3kRcK8s7F+cKPolEuiptkDIv7By5oawJhWZZ5STwn6Igs7LV81xL+WrCsADDsZfdcigoEsuczYQxa1TcF+ReuiDfBWuTNPtqRGI+UyUmh4uRvw2eaZa6ZajdnpimqB0irRzF0aLSXzLqg1nZTkvnxqE798rlKo5hywmHbZ1Z8wIglWctuimQYFUgGeUI3PrDWdXq/r5/IcTjzqoZL9c5nCez16Dhpmq0c5R9PIpDtFf6tgHoxIH4f7bWDiWSYOM088+GV86DlzNtWSOSrhsxiCtDiHCVVqjjsB6HH/v/+5YB2CmYGQTaPFyfHav1FGHFdz0ZNIg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L3W9FB2Gk0qdDEIJ2/eH/gXOVUsxlGZsvZL1WnKoqLfNzFs7B6IRuk0oDekMy/wNwYDarXHAiOcGs7FCDuPnYltAJ00CT6n/zZAuWmvw1iC3JERL2+HkjOjv81ENpdBdrKPrpWIUvI19y4JvWN0Qz3NJNE0eB0RpQPvxNu0/H/naziG1gjfHgGT2Gi38g6k8vh96R8pqME1IRxFu0cZc7wQyiH/0JRnbsjsl1bhcCJFekEw+7wk7rYxSWnLsmCIDH0EQZAInXAG6cFKRyWmQ0BjwkOQJuJ5k63uXsEVYLbk+Srf3ufULqatLnTkYt9yz41JcnTCiuhXYOhvampaLDA==
  • 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: Tue, 03 May 2022 14:44:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.05.2022 14:37, Roger Pau Monné wrote:
> On Mon, Apr 25, 2022 at 10:33:32AM +0200, Jan Beulich wrote:
>> --- a/xen/drivers/passthrough/iommu.c
>> +++ b/xen/drivers/passthrough/iommu.c
>> @@ -307,11 +338,10 @@ int iommu_map(struct domain *d, dfn_t df
>>          if ( !d->is_shutting_down && printk_ratelimit() )
>>              printk(XENLOG_ERR
>>                     "d%d: IOMMU mapping dfn %"PRI_dfn" to mfn %"PRI_mfn" 
>> failed: %d\n",
>> -                   d->domain_id, dfn_x(dfn_add(dfn, i)),
>> -                   mfn_x(mfn_add(mfn, i)), rc);
>> +                   d->domain_id, dfn_x(dfn), mfn_x(mfn), rc);
> 
> Since you are already adjusting the line, I wouldn't mind if you also
> switched to use %pd at once (and in the same adjustment done to
> iommu_unmap).

I did consider doing so, but decided against since this would lead
to also touching the format string (which right now is unaltered).

>>  
>>          /* while statement to satisfy __must_check */
>> -        while ( iommu_unmap(d, dfn, i, flush_flags) )
>> +        while ( iommu_unmap(d, dfn0, i, flush_flags) )
> 
> To match previous behavior you likely need to use i + (1UL << order),
> so pages covered by the map_page call above are also taken care in the
> unmap request?

I'm afraid I don't follow: Prior behavior was to unmap only what
was mapped on earlier iterations. This continues to be that way.

> With that fixed:
> 
> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks, but I'll wait with applying this.

Jan




 


Rackspace

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