All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/23] Add SMMUv3 Stage 1 Support for Xen guests
@ 2026-03-23 22:50 Milan Djokic
  2026-03-23 22:51 ` [PATCH v2 01/23] xen/arm: smmuv3: Maintain a SID->device structure Milan Djokic
                   ` (23 more replies)
  0 siblings, 24 replies; 106+ messages in thread
From: Milan Djokic @ 2026-03-23 22:50 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Milan Djokic, Bertrand Marquis, Rahul Singh, Stefano Stabellini,
	Julien Grall, Michal Orzel, Volodymyr Babchuk, Jan Beulich,
	Roger Pau Monné, Anthony PERARD, Nick Rosbrook,
	George Dunlap, Juergen Gross, Andrew Cooper, Daniel P. Smith

This patch series provides emulated SMMUv3 support in Xen, enabling stage-1
translation for the guest OS.

Stage 1 translation support is required to provide isolation between different
devices within OS. Xen already supports Stage 2 translation but there is no
support for Stage 1 translation. The goal of this work is to support Stage 1
translation for Xen guests.

This patch series represents a continuation of work from Rahul Singh:
https://patchwork.kernel.org/project/xen-devel/cover/cover.1669888522.git.rahul.singh@arm.com/
Original patch series is aligned with the newest Xen structure, with the addition
of translation layer which provides 1:N vIOMMU->pIOMMU mapping, in order to
support passthrough of the devices attached to different physical IOMMUs.

We cannot trust the guest OS to control the SMMUv3 hardware directly as
compromised guest OS can corrupt the SMMUv3 configuration and make the system
vulnerable. The guest gets the ownership of the stage 1 page tables and also
owns stage 1 configuration structures. The Xen handles the root configuration
structure (for security reasons), including the stage 2 configuration.

XEN will emulate the SMMUv3 hardware and expose the virtual SMMUv3 to the
guest. Guest can use the native SMMUv3 driver to configure the stage 1
translation. When the guest configures the SMMUv3 for Stage 1, XEN will trap
the access and configure hardware.

SMMUv3 Driver(Guest OS) -> Configure the Stage-1 translation ->
XEN trap access -> XEN SMMUv3 driver configure the HW.

The final patch series commit provides a design document for the emulated
IOMMU (arm-viommu.rst), which was previously discussed with the maintainers.
Details regarding implementation, future work and security risks are outlined
in this document.

---
Changes in v2:
 - Updated design and implementation with vIOMMU->pIOMMU mapping layer
 - Addressed security risks in the design, provided initial performance
   measurements
 - Addressed comments from previous version
 - Tested on Renesas R-Car platform, initial performance measurements for
   stage-1 vs stage-1-less guests
---

Jean-Philippe Brucker (1):
  xen/arm: smmuv3: Maintain a SID->device structure

Milan Djokic (3):
  xen/arm: vIOMMU vSID->pSID mapping layer
  libxl/arm: Introduce domctl command for IOMMU vSID/vRID mapping
  doc/arm: vIOMMU design document

Rahul Singh (19):
  xen/arm: smmuv3: Add support for stage-1 and nested stage translation
  xen/arm: smmuv3: Alloc io_domain for each device
  xen/arm: vIOMMU: add generic vIOMMU framework
  xen/arm: vsmmuv3: Add dummy support for virtual SMMUv3 for guests
  xen/domctl: Add XEN_DOMCTL_CONFIG_VIOMMU_* and viommu config param
  xen/arm: vIOMMU: Add cmdline boot option "viommu = <string>"
  xen/arm: vsmmuv3: Add support for registers emulation
  xen/arm: vsmmuv3: Add support for cmdqueue handling
  xen/arm: vsmmuv3: Add support for command CMD_CFGI_STE
  xen/arm: vsmmuv3: Attach Stage-1 configuration to SMMUv3 hardware
  xen/arm: vsmmuv3: Add support for event queue and global error
  xen/arm: vsmmuv3: Add "iommus" property node for dom0 devices
  xen/arm: vIOMMU: IOMMU device tree node for dom0
  xen/arm: vsmmuv3: Emulated SMMUv3 device tree node for dom0less
  arm/libxl: vsmmuv3: Emulated SMMUv3 device tree node in libxl
  xen/arm: vsmmuv3: Alloc virq for virtual SMMUv3
  xen/arm: vsmmuv3: Add support to send stage-1 event to guest
  libxl/arm: vIOMMU: Modify the partial device tree for iommus
  xen/arm: vIOMMU: Modify the partial device tree for dom0less

 docs/designs/arm-viommu.rst             | 390 ++++++++++
 docs/man/xl.cfg.5.pod.in                |  13 +
 docs/misc/xen-command-line.pandoc       |   9 +
 tools/golang/xenlight/helpers.gen.go    |   2 +
 tools/golang/xenlight/types.gen.go      |   1 +
 tools/include/libxl.h                   |   5 +
 tools/include/xenctrl.h                 |  12 +
 tools/libs/ctrl/xc_domain.c             |  23 +
 tools/libs/light/libxl_arm.c            | 230 +++++-
 tools/libs/light/libxl_types.idl        |   6 +
 tools/xl/xl_parse.c                     |   9 +
 xen/arch/arm/dom0less-build.c           |  72 ++
 xen/arch/arm/domain.c                   |  26 +
 xen/arch/arm/domain_build.c             | 103 ++-
 xen/arch/arm/domctl.c                   |  31 +
 xen/arch/arm/include/asm/domain.h       |   4 +
 xen/arch/arm/include/asm/iommu.h        |   7 +
 xen/arch/arm/include/asm/viommu.h       | 113 +++
 xen/common/device-tree/dom0less-build.c |  55 +-
 xen/drivers/passthrough/Kconfig         |  13 +
 xen/drivers/passthrough/arm/Makefile    |   2 +
 xen/drivers/passthrough/arm/smmu-v3.c   | 369 ++++++++-
 xen/drivers/passthrough/arm/smmu-v3.h   |  49 +-
 xen/drivers/passthrough/arm/viommu.c    |  96 +++
 xen/drivers/passthrough/arm/vsmmu-v3.c  | 958 ++++++++++++++++++++++++
 xen/drivers/passthrough/arm/vsmmu-v3.h  |  32 +
 xen/include/public/arch-arm.h           |  14 +-
 xen/include/public/device_tree_defs.h   |   1 +
 xen/include/public/domctl.h             |  18 +
 xen/include/xen/iommu.h                 |  13 +-
 xen/xsm/flask/hooks.c                   |   4 +
 xen/xsm/flask/policy/access_vectors     |   2 +
 32 files changed, 2627 insertions(+), 55 deletions(-)
 create mode 100644 docs/designs/arm-viommu.rst
 create mode 100644 xen/arch/arm/include/asm/viommu.h
 create mode 100644 xen/drivers/passthrough/arm/viommu.c
 create mode 100644 xen/drivers/passthrough/arm/vsmmu-v3.c
 create mode 100644 xen/drivers/passthrough/arm/vsmmu-v3.h

-- 
2.43.0

^ permalink raw reply	[flat|nested] 106+ messages in thread

end of thread, other threads:[~2026-05-13  9:41 UTC | newest]

Thread overview: 106+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23 22:50 [PATCH v2 00/23] Add SMMUv3 Stage 1 Support for Xen guests Milan Djokic
2026-03-23 22:51 ` [PATCH v2 01/23] xen/arm: smmuv3: Maintain a SID->device structure Milan Djokic
2026-03-25 18:57   ` Mykola Kvach
2026-03-23 22:51 ` [PATCH v2 02/23] xen/arm: smmuv3: Add support for stage-1 and nested stage translation Milan Djokic
2026-04-14  2:17   ` Julien Grall
2026-04-19 17:34     ` Milan Djokic
2026-04-21  8:43       ` Julien Grall
2026-04-28 10:16         ` Milan Djokic
2026-03-23 22:51 ` [PATCH v2 03/23] xen/arm: smmuv3: Alloc io_domain for each device Milan Djokic
2026-03-23 22:51 ` [PATCH v2 04/23] xen/arm: vIOMMU: add generic vIOMMU framework Milan Djokic
2026-03-24  8:27   ` Jan Beulich
2026-03-26 12:52     ` Milan Djokic
2026-03-24  8:48   ` Jan Beulich
2026-03-23 22:51 ` [PATCH v2 05/23] xen/arm: vsmmuv3: Add dummy support for virtual SMMUv3 for guests Milan Djokic
2026-03-24  8:29   ` Jan Beulich
2026-03-23 22:51 ` [PATCH v2 06/23] xen/domctl: Add XEN_DOMCTL_CONFIG_VIOMMU_* and viommu config param Milan Djokic
2026-03-25 18:52   ` Nick Rosbrook
2026-03-26 19:35     ` Milan Djokic
2026-03-23 22:51 ` [PATCH v2 07/23] xen/arm: vIOMMU: Add cmdline boot option "viommu = <string>" Milan Djokic
2026-03-23 22:51 ` [PATCH v2 08/23] xen/arm: vsmmuv3: Add support for registers emulation Milan Djokic
2026-03-23 22:51 ` [PATCH v2 09/23] xen/arm: vsmmuv3: Add support for cmdqueue handling Milan Djokic
2026-03-23 22:51 ` [PATCH v2 10/23] xen/arm: vsmmuv3: Add support for command CMD_CFGI_STE Milan Djokic
2026-03-23 22:51 ` [PATCH v2 11/23] xen/arm: vsmmuv3: Attach Stage-1 configuration to SMMUv3 hardware Milan Djokic
2026-03-24  8:35   ` Jan Beulich
2026-03-23 22:51 ` [PATCH v2 13/23] xen/arm: vsmmuv3: Add "iommus" property node for dom0 devices Milan Djokic
2026-03-23 22:51 ` [PATCH v2 12/23] xen/arm: vsmmuv3: Add support for event queue and global error Milan Djokic
2026-03-23 22:51 ` [PATCH v2 14/23] xen/arm: vIOMMU: IOMMU device tree node for dom0 Milan Djokic
2026-03-23 22:51 ` [PATCH v2 15/23] xen/arm: vsmmuv3: Emulated SMMUv3 device tree node for dom0less Milan Djokic
2026-03-23 22:51 ` [PATCH v2 16/23] arm/libxl: vsmmuv3: Emulated SMMUv3 device tree node in libxl Milan Djokic
2026-03-23 22:51 ` [PATCH v2 17/23] xen/arm: vsmmuv3: Alloc virq for virtual SMMUv3 Milan Djokic
2026-03-23 22:51 ` [PATCH v2 18/23] xen/arm: vsmmuv3: Add support to send stage-1 event to guest Milan Djokic
2026-03-23 22:51 ` [PATCH v2 19/23] libxl/arm: vIOMMU: Modify the partial device tree for iommus Milan Djokic
2026-03-23 22:51 ` [PATCH v2 20/23] xen/arm: vIOMMU: Modify the partial device tree for dom0less Milan Djokic
2026-03-23 22:51 ` [PATCH v2 21/23] xen/arm: vIOMMU vSID->pSID mapping layer Milan Djokic
2026-03-23 22:51 ` [PATCH v2 22/23] libxl/arm: Introduce domctl command for IOMMU vSID/vRID mapping Milan Djokic
2026-03-24  8:38   ` Jan Beulich
2026-03-23 22:51 ` [PATCH v2 23/23] doc/arm: vIOMMU design document Milan Djokic
2026-03-25 19:13   ` Mykola Kvach
2026-03-31  1:51 ` [PATCH v3 00/23] Add SMMUv3 Stage 1 Support for Xen guests Milan Djokic
2026-03-31  1:51   ` [PATCH v3 01/23] xen/arm: smmuv3: Maintain a SID->device structure Milan Djokic
2026-04-09 14:59     ` Luca Fancellu
2026-04-19 17:29       ` Milan Djokic
2026-03-31  1:51   ` [PATCH v3 02/23] xen/arm: smmuv3: Add support for stage-1 and nested stage translation Milan Djokic
2026-04-10  9:49     ` Luca Fancellu
2026-04-19 17:55       ` Milan Djokic
2026-03-31  1:52   ` [PATCH v3 03/23] xen/arm: smmuv3: Alloc io_domain for each device Milan Djokic
2026-04-10  9:57     ` Luca Fancellu
2026-04-14  6:06     ` Julien Grall
2026-03-31  1:52   ` [PATCH v3 04/23] xen/arm: vIOMMU: add generic vIOMMU framework Milan Djokic
2026-03-31  8:16     ` Jan Beulich
2026-04-10 10:41     ` Luca Fancellu
2026-04-14  6:19       ` Julien Grall
2026-04-10 11:39     ` Luca Fancellu
2026-05-03 10:38       ` Milan Djokic
2026-04-14  6:15     ` Julien Grall
2026-05-03 10:44       ` Milan Djokic
2026-03-31  1:52   ` [PATCH v3 05/23] xen/arm: vsmmuv3: Add dummy support for virtual SMMUv3 for guests Milan Djokic
2026-04-10 11:59     ` Luca Fancellu
2026-05-03 11:04       ` Milan Djokic
2026-04-14  7:09     ` Julien Grall
2026-05-03 18:38       ` Milan Djokic
2026-03-31  1:52   ` [PATCH v3 06/23] xen/domctl: Add XEN_DOMCTL_CONFIG_VIOMMU_* and viommu config param Milan Djokic
2026-03-31  8:18     ` Jan Beulich
2026-04-01 14:03     ` Nick Rosbrook
2026-04-10 14:08     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 07/23] xen/arm: vIOMMU: Add cmdline boot option "viommu = <string>" Milan Djokic
2026-04-10 14:28     ` Luca Fancellu
2026-05-13  9:41       ` Milan Djokic
2026-04-14  7:18     ` Julien Grall
2026-05-13  9:40       ` Milan Djokic
2026-03-31  1:52   ` [PATCH v3 09/23] xen/arm: vsmmuv3: Add support for cmdqueue handling Milan Djokic
2026-04-13  8:48     ` Luca Fancellu
2026-04-14  8:18     ` Julien Grall
2026-03-31  1:52   ` [PATCH v3 08/23] xen/arm: vsmmuv3: Add support for registers emulation Milan Djokic
2026-04-10 15:27     ` Luca Fancellu
2026-04-14  8:10     ` Julien Grall
2026-03-31  1:52   ` [PATCH v3 10/23] xen/arm: vsmmuv3: Add support for command CMD_CFGI_STE Milan Djokic
2026-04-13  9:48     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 11/23] xen/arm: vsmmuv3: Attach Stage-1 configuration to SMMUv3 hardware Milan Djokic
2026-03-31  8:20     ` Jan Beulich
2026-04-13 10:26     ` Luca Fancellu
2026-04-13 11:20       ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 12/23] xen/arm: vsmmuv3: Add support for event queue and global error Milan Djokic
2026-04-13 11:06     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 13/23] xen/arm: vsmmuv3: Add "iommus" property node for dom0 devices Milan Djokic
2026-04-13 11:16     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 14/23] xen/arm: vIOMMU: IOMMU device tree node for dom0 Milan Djokic
2026-04-13 11:46     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 15/23] xen/arm: vsmmuv3: Emulated SMMUv3 device tree node for dom0less Milan Djokic
2026-04-13 11:50     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 16/23] arm/libxl: vsmmuv3: Emulated SMMUv3 device tree node in libxl Milan Djokic
2026-04-13 13:44     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 17/23] xen/arm: vsmmuv3: Alloc virq for virtual SMMUv3 Milan Djokic
2026-04-13 14:08     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 18/23] xen/arm: vsmmuv3: Add support to send stage-1 event to guest Milan Djokic
2026-04-13 14:15     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 19/23] libxl/arm: vIOMMU: Modify the partial device tree for iommus Milan Djokic
2026-04-13 14:41     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 20/23] xen/arm: vIOMMU: Modify the partial device tree for dom0less Milan Djokic
2026-04-13 14:46     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 21/23] xen/arm: vIOMMU vSID->pSID mapping layer Milan Djokic
2026-04-13 15:10     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 22/23] libxl/arm: Introduce domctl command for IOMMU vSID/vRID mapping Milan Djokic
2026-04-13 16:24     ` Luca Fancellu
2026-03-31  1:52   ` [PATCH v3 23/23] doc/arm: vIOMMU design document Milan Djokic
2026-04-14  2:21   ` [PATCH v3 00/23] Add SMMUv3 Stage 1 Support for Xen guests Julien Grall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.