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 <[email protected]> For the vm_event part.
Reviewed-by: Alexandru Isaila <[email protected]> > --- > Cc: Stefano Stabellini <[email protected]> > Cc: Julien Grall <[email protected]> > Cc: Volodymyr Babchuk <[email protected]> > Cc: Andrew Cooper <[email protected]> > Cc: George Dunlap <[email protected]> > Cc: Ian Jackson <[email protected]> > Cc: Jan Beulich <[email protected]> > Cc: Konrad Rzeszutek Wilk <[email protected]> > Cc: Tim Deegan <[email protected]> > Cc: Wei Liu <[email protected]> > Cc: "Roger Pau Monné" <[email protected]> > Cc: Tamas K Lengyel <[email protected]> > Cc: George Dunlap <[email protected]> > Cc: Razvan Cojocaru <[email protected]> > Cc: Alexandru Isaila <[email protected]> > Cc: Petre Pircalabu <[email protected]> > --- > 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 [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
