From: Milan Djokic <milan_djokic@epam.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Milan Djokic" <milan_djokic@epam.com>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Rahul Singh" <rahul.singh@arm.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>,
"Michal Orzel" <michal.orzel@amd.com>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Nick Rosbrook" <enr0n@ubuntu.com>,
"George Dunlap" <gwd@xenproject.org>,
"Juergen Gross" <jgross@suse.com>,
"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH v3 00/23] Add SMMUv3 Stage 1 Support for Xen guests
Date: Tue, 31 Mar 2026 01:51:48 +0000 [thread overview]
Message-ID: <cover.1774918270.git.milan_djokic@epam.com> (raw)
In-Reply-To: <cover.1774305918.git.milan_djokic@epam.com>
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
---
---
Changes in v3:
- Bump domctl version, added explicit padding for the new domctl structures
- Remove unnecessary changes according to review comments
- Add "ARM" prefix for vIOMMU Kconfig options, since only ARM architecture is
supported at this point
- Re-generate go code
- Add missing commit sign-off tags
---
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 | 7 +
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 | 34 +
xen/arch/arm/domain_build.c | 103 ++-
xen/arch/arm/domctl.c | 34 +
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 | 15 +-
xen/include/public/device_tree_defs.h | 1 +
xen/include/public/domctl.h | 24 +-
xen/include/xen/iommu.h | 6 +
xen/xsm/flask/hooks.c | 4 +
xen/xsm/flask/policy/access_vectors | 2 +
32 files changed, 2646 insertions(+), 53 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
next prev parent reply other threads:[~2026-03-31 1:52 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Milan Djokic [this message]
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 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 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 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1774918270.git.milan_djokic@epam.com \
--to=milan_djokic@epam.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bertrand.marquis@arm.com \
--cc=dpsmith@apertussolutions.com \
--cc=enr0n@ubuntu.com \
--cc=gwd@xenproject.org \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=rahul.singh@arm.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.