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

your change "iommu: make map and unmap take a page count, similar to flush"


  • To: Paul Durrant <paul@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 21 Jul 2021 17:58:35 +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-SenderADCheck; bh=5FOiuvQ1lHPaZMdImszYY/nt3sbsFeU2u+zkCtu7vEw=; b=W7UVNB310jI6qMZw+pJSzOMo1rPfKekpOUfWM8n3H4AeEwbfrj7FtPUBT94kBU7Cgj7YW6WUO3/WOPbeJ6uaTkIpnPVM9llAWorE2o9q7V2m23tjqf7O+7+2OMc9KFDCJmWgH4rwwRXjOfav0pPiIyv7/amVC+cnhQERrmwrdReCn4ZnvrNL0KXRK7VilabZDT4c+xQY9csUEM+UkcG8jjUY2MxI2AuFx6Dzu51eBbtsQKHnDYFuyQQknybn4FxSW0ehxUvXiLhAiQszDwboqSDvmQcIZ+nv7nejgLBUOeFvlwqe+tMcMjStUEz+KEJN4/eysD9Po83gj1YR/k+iVg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g1aeiy2Ob7n49rpxPvZW0zwAmsH5T6IptLI4pI1g2jSZJc9w6t9K4AyxEaLdqc6ZqGFKu0yDR1tMo4G83MpyYWWqRMOMD+CDB4ofBBYAatGNmDSEIDR72JbPFcBTt9/ov6PhXLHE4+VQMHcsFekSLgBg/n16czNGChumKqfqOsUt+nAeAEDHKxMViaJmxWgVDo/HCZacCVx3pel1pbnnKDuwc7tcPkglddIlY/xLSSeHaxKkkHTiNNM06ZZ6b68oI389tZUWAGDSyp4rlb+a1YEXbDQQgb1x7OqDzTijGJuCqM4ZQgpacH9NhrlSjyHvxVc2vm0b7vjRUsRfvYFSOQ==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 21 Jul 2021 15:58:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Paul,

the description of this says

"At the moment iommu_map() and iommu_unmap() take a page order rather than a
 count, whereas iommu_iotlb_flush() takes a page count rather than an order.
 This patch makes them consistent with each other, opting for a page count since
 CPU page orders are not necessarily the same as those of an IOMMU."

I don't understand the latter sentence at all, now that I read it again.
What may differ is the base page size, but that affects counts of pages
and page order all the same.

I'm intending to make an attempt to cut through the page order (or
count) to the actual vendor functions, in order to then be able to
establish large page mappings where possible. In all cases (perhaps
most noticable on Arm) handing them a page order would seem easier, so
I was considering to have iommu_{,un}map() do that step of abstraction
(or transformation). But since you did explicitly convert from order to
count, I was wondering whether me following this plan would cause
problems with any of your further intentions back then.

If we really wanted to cater for base page size varying between CPU and
IOMMU, besides the IOMMU vendor code needing to announce their value, I
guess we'd have to do quite a bit more abstracting work, as it would
matter to outer layers in particular if the IOMMU base page size was
larger than the CPU's. Supporting just smaller IOMMU base page sizes,
otoh, would seem entirely feasible to deal with inside the rework of
iommu_{,un}map() as mentioned above.

Jan




 


Rackspace

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