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.durr...@citrix.com>
For the vm_event part.

Reviewed-by: Alexandru Isaila <aisa...@bitdefender.com>

> ---
> Cc: Stefano Stabellini <sstabell...@kernel.org>
> Cc: Julien Grall <julien.gr...@arm.com>
> Cc: Volodymyr Babchuk <volodymyr_babc...@epam.com>
> Cc: Andrew Cooper <andrew.coop...@citrix.com>
> Cc: George Dunlap <george.dun...@eu.citrix.com>
> Cc: Ian Jackson <ian.jack...@eu.citrix.com>
> Cc: Jan Beulich <jbeul...@suse.com>
> Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
> Cc: Tim Deegan <t...@xen.org>
> Cc: Wei Liu <w...@xen.org>
> Cc: "Roger Pau Monné" <roger....@citrix.com>
> Cc: Tamas K Lengyel <ta...@tklengyel.com>
> Cc: George Dunlap <george.dun...@eu.citrix.com>
> Cc: Razvan Cojocaru <rcojoc...@bitdefender.com>
> Cc: Alexandru Isaila <aisa...@bitdefender.com>
> Cc: Petre Pircalabu <ppircal...@bitdefender.com>
> ---
>   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@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to