Skip to content

RFC Implement Xen PV-IOMMU interface

Malcolm Crossley xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7common/pv-iommu: Add stub hypercall for PV-IOMMUxen/arch/x86/x86_64/compat/entry.S xen/arch/x86/x86_64/entry.S xen/common/Makefile +2 more+44 -02 replies
2/7iommu: add iommu_lookup_page to lookup guest gfn for a particular IOMMU mappingxen/drivers/passthrough/iommu.c xen/include/xen/iommu.h+23 -03 replies
3/7VT-d: Add iommu_lookup_page supportxen/drivers/passthrough/vtd/iommu.c xen/drivers/passthrough/vtd/iommu.h+32 -01 reply
4/7common/pv-iommu: Add query, map and unmap opsxen/common/pv_iommu.c xen/include/public/pv-iommu.h+296 -12 replies
5/7x86/m2b: Add a tracking structure for mfn to bfn mappings per pagexen/arch/x86/domain.c xen/arch/x86/mm/Makefile xen/arch/x86/mm/m2b.c +6 more+308 -21 reply
6/7common/pv-iommu: Add foreign ops to PV-IOMMU interfacexen/common/pv_iommu.c xen/include/public/pv-iommu.h xen/include/xsm/dummy.h +2 more+304 -01 reply
7/7common/pv-iommu: Allow hardware_domain to pre IOMMU map foreign memoryxen/arch/x86/mm/m2b.c xen/common/pv_iommu.c xen/include/asm-x86/m2b.h +1 more+110 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/7] Implement Xen PV-IOMMU interface

This RFC series implements the PV-IOMMU interface according to the PV-IOMMU design draft D.

The PV-IOMMU interface is currently restricted to being used by the hardware domain only as non hardware domain callers have not been fully tested yet.

Significant effort was put into implementing a m2b tracking structure without increasing the size of struct page but no union was found that could be safely used in all cases when a page is allocated to an HVM domain. Comments and feedback on the m2b design are most welcome.

The hardware domain specific IOMMU pre map mechanism was implemented in order to keep performance parity with current out of tree mechanisms to obtain BFNs for foreign guest owned memory. The pre map mechanism is not a weakening of the current security model of Xen and is only allowed when the hardware domain is allowed relaxed IOMMU mappings.

Malcolm Crossley (7):
common/pv-iommu: Add stub hypercall for PV-IOMMU
iommu: add iommu_lookup_page to lookup guest gfn for a particular
IOMMU mapping
VT-d: Add iommu_lookup_page support
common/pv-iommu: Add query, map and unmap ops
x86/m2b: Add a tracking structure for mfn to bfn mappings per page common/pv-iommu: Add foreign ops to PV-IOMMU interface common/pv-iommu: Allow hardware_domain to pre IOMMU map foreign
memory

 xen/arch/x86/domain.c               |  12 +-
 xen/arch/x86/mm/Makefile            |   1 +
 xen/arch/x86/mm/m2b.c               | 211 ++++++++++++
 xen/arch/x86/x86_64/compat/entry.S  |   2 +
 xen/arch/x86/x86_64/entry.S         |   2 +
 xen/common/Makefile                 |   1 +
 xen/common/memory.c                 |  11 +
 xen/common/pv_iommu.c               | 633 ++++++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/iommu.c     |  21 ++
 xen/drivers/passthrough/vtd/iommu.c |  31 ++
 xen/drivers/passthrough/vtd/iommu.h |   1 +
 xen/include/asm-x86/domain.h        |   1 +
 xen/include/asm-x86/m2b.h           |  65 ++++
 xen/include/asm-x86/mm.h            |  12 +-
 xen/include/public/hvm/ioreq.h      |   1 +
 xen/include/public/pv-iommu.h       |  93 ++++++
 xen/include/public/xen.h            |   1 +
 xen/include/xen/iommu.h             |   2 +
 xen/include/xen/sched.h             |   4 +
 xen/include/xsm/dummy.h             |   6 +
 xen/include/xsm/xsm.h               |   6 +
 xen/xsm/dummy.c                     |   1 +
 22 files changed, 1116 insertions(+), 2 deletions(-)
 create mode 100644 xen/arch/x86/mm/m2b.c
 create mode 100644 xen/common/pv_iommu.c
 create mode 100644 xen/include/asm-x86/m2b.h
 create mode 100644 xen/include/public/pv-iommu.h