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

Re: [Xen-devel] [PATCH 3/6] remove late (on-demand) construction of IOMMU page tables


  • To: Paul Durrant <paul.durrant@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alexandru Stefan ISAILA <aisaila@xxxxxxxxxxxxxxx>
  • Date: Thu, 1 Aug 2019 08:05:10 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=bitdefender.com;dmarc=pass action=none header.from=bitdefender.com;dkim=pass header.d=bitdefender.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=gVEoFUbd5yXTXAGcGDNlvLnEUnLNIC9VtjMIHtG1I6M=; b=LeZ1IPlCD7XrpbK7qUf+nCp/l8n3kU4eBPQaMUlYB3S17qfhzkHrHHJTIVevAeVY/1Gsql6s5qSbwoUwYgMv1G175iTwTrZcKL8BvlBqBUqyhwIFVTI/ZgdQpVDJYoD0BZCFnhuDhntFk64v/X8WrH4VvJpJm/5p+VcFNUrm8Mo59gwJfMJRPIVOqoN+FmeYUgBpruxPups7lY+aNR8HS0Dr6Exd+Tsf8e7ca710pz6X1j5VYVgzE4AxJSLdHCSqRIrLLOU6oIuEVb9CnmAmwkuMawHyHgAor6lodqIiXnss3BlWc4t+lfJ5iyml4l/5MwkjZiFcuX0EIdtVFB3jCg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CPwKVUr8ScpkqdJhjTeaO4mDXd2yN28vvlEpn/59kiT/mtjTD6w9wUXv7STMQrQ4JNYPzbN8Ot3C3LsjxkldFaZRdXVQ3qc2snGalLcMVJsg/X3K/mjbLP/RGRTtolHwwYm5wUjFf+7CcAiQQttRE5Qc77GDPfhOvfceYcebVLqVIzJfMihByhgfDGJr9Xs4JfVSVkcykyT7uQDnkVHLeSLa5C+6nExXr5SuubzLqqcgE6AB2Pt9dWiHDZ+QlDYSDIXwggWPHfCC5+C96zn3uheFmga1bciFCSGLoXCj/Af6qhGVub+py19voe32KOWJnGM+xyCwGKFG/Ksx723Y+Q==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisaila@xxxxxxxxxxxxxxx;
  • Cc: Petre Ovidiu PIRCALABU <ppircalabu@xxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 01 Aug 2019 08:05:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVRt0NS7ptkuDxekacC+PpPXyb/qbl8e+A
  • Thread-topic: [PATCH 3/6] remove late (on-demand) construction of IOMMU page tables


On 30.07.2019 16:44, Paul Durrant wrote:
> Now that there is a per-domain IOMMU enable flag, which should be enabled if
> any device is going to be passed through, stop deferring page table
> construction until the assignment is done. Also don't tear down the tables
> again when the last device is de-assigned; defer that task until domain
> destruction.
> 
> This allows the has_iommu_pt() helper and iommu_status enumeration to be
> removed. Calls to has_iommu_pt() are simply replaced by calls to
> is_iommu_enabled(). Remaining open-code tests of iommu_hap_pt_share can also
> be replaced by calls to iommu_use_hap_pt().
> The arch_iommu_populate_page_table() and iommu_construct() functions become
> redundant, as does the 'strict mode' dom0 page_list mapping code in
> iommu_hwdom_init(), and iommu_teardown() can be made static is its only
> remaining caller, iommu_domain_destroy(), is within the same source
> module.
> 
> All in all, about 220 lines of code are rmeoved.
> 
> NOTE: This patch will cause a small amount of extra resource to be used
>        to accommodate IOMMU page tables that may never be used, since the
>        per-domain IOMMU flag enable flag is currently set to the value
>        of the global iommu_enable flag. A subsequent patch will add an
>        option to the toolstack to allow it to be turned off if there is
>        no intention to assign passthrough hardware to the domain.
> 
> Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
For the vm_event part.

Reviewed-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>

> ---
> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Cc: Julien Grall <julien.grall@xxxxxxx>
> Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Jan Beulich <jbeulich@xxxxxxxx>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> Cc: Tim Deegan <tim@xxxxxxx>
> Cc: Wei Liu <wl@xxxxxxx>
> Cc: "Roger Pau Monné" <roger.pau@xxxxxxxxxx>
> Cc: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
> Cc: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
> Cc: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
> Cc: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
> Cc: Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>
> ---
>   xen/arch/arm/p2m.c                    |   2 +-
>   xen/arch/x86/dom0_build.c             |   2 +-
>   xen/arch/x86/hvm/mtrr.c               |   5 +-
>   xen/arch/x86/mm/mem_sharing.c         |   2 +-
>   xen/arch/x86/mm/paging.c              |   2 +-
>   xen/arch/x86/x86_64/mm.c              |   2 +-
>   xen/common/memory.c                   |   4 +-
>   xen/common/vm_event.c                 |   2 +-
>   xen/drivers/passthrough/device_tree.c |  11 ---
>   xen/drivers/passthrough/iommu.c       | 134 ++++++--------------------
>   xen/drivers/passthrough/pci.c         |  12 ---
>   xen/drivers/passthrough/vtd/iommu.c   |  10 +-
>   xen/drivers/passthrough/x86/iommu.c   |  95 ------------------
>   xen/include/asm-arm/iommu.h           |   2 +-
>   xen/include/asm-x86/iommu.h           |   2 +-
>   xen/include/xen/iommu.h               |  16 ---
>   xen/include/xen/sched.h               |   2 -
>   17 files changed, 42 insertions(+), 263 deletions(-)
> 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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