Skip to content

IOMMU, vtd and iotlb flush rework (v5)

Jean Guyader xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 6 repliesIn review

changes between v4 and v5 from the cover letter

- Fix hypercall continuation for add_to_physmap in compat mode.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6vtd: Refactor iotlb flush codexen/drivers/passthrough/vtd/iommu.c+43 -430 replies
2/6iommu: Introduce iommu_flush and iommu_flush_all.xen/drivers/passthrough/iommu.c xen/drivers/passthrough/vtd/iommu.c xen/include/xen/iommu.h+37 -00 replies
3/6add_to_physmap: Move the code for XENMEM_add_to_physmap.xen/arch/x86/mm.c+99 -890 replies
4/6mm: New XENMEM space, XENMAPSPACE_gmfn_rangexen/arch/x86/mm.c xen/arch/x86/x86_64/compat/mm.c xen/include/public/memory.h+108 -706 replies
5/6hvmloader: Change memory relocation loop when overlap with PCI hole.tools/firmware/hvmloader/pci.c+14 -60 replies
6/6Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flushxen/arch/x86/mm.c xen/drivers/passthrough/iommu.c xen/drivers/passthrough/vtd/iommu.c +1 more+35 -20 replies

Reviews trailers per patch

4 of 6 patches have a Reviewed-by or Acked-by.

PatchAllen M KayTim Deegan
1/6A-b
2/6A-b
3/6A-b
4/6
5/6
6/6A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v5)

In one of my previous email I detailed a bug I was seeing when passing through a Intel GPU on a guest that has more that 4G or RAM.

Allen suggested that I go for the Plan B but after a discussion with Tim we agreed that Plan B was way to disruptive in term of code change.

This patch series implements Plan A.

http://xen.1045712.n5.nabble.com/VTD-Intel-iommu-IOTLB-flush-really-slow-td4952866.html

changes between v4 and v5:
- Fix hypercall continuation for add_to_physmap in compat mode.

Changes between v3 and v4:
- Move the loop for gmfn_range from arch_memory_op to xenmem_add_to_physmap.
- Add a comment to comment to explain the purpose of iommu_dont_flush_iotlb.

Changes between v2 and v3:
- Check for the presence iotlb_flush_all callback before calling it.

Changes between v1 and v2:
- Move size in struct xen_add_to_physmap in padding between .domid and .space.
- Store iommu_dont_flush per cpu
- Change the code in hvmloader to relocate by batch of 64K, .size is now 16 bits.

Jean Guyader (6):
vtd: Refactor iotlb flush code
iommu: Introduce iommu_flush and iommu_flush_all.
add_to_physmap: Move the code for XENMEM_add_to_physmap.
mm: New XENMEM space, XENMAPSPACE_gmfn_range
hvmloader: Change memory relocation loop when overlap with PCI hole. Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary
iotlb flush

 tools/firmware/hvmloader/pci.c      |   20 +++++--
 xen/arch/x86/mm.c                   |   82 ++++++++++++++++++++++------
 xen/arch/x86/x86_64/compat/mm.c     |   10 ++++
 xen/drivers/passthrough/iommu.c     |   25 +++++++++
 xen/drivers/passthrough/vtd/iommu.c |  100 ++++++++++++++++++++---------------
 xen/include/public/memory.h         |    4 ++
 xen/include/xen/iommu.h             |   17 ++++++
 7 files changed, 192 insertions(+), 66 deletions(-)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel