Skip to contentSkip to conversation

uboot-script-gen: Add support for "passthrough" property

PATCH In review Oleksandr Tyshchenko 2 participants 2 messages Dec 1, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uboot-script-gen: Add support for "passthrough" property

This property is used to grant a non-hardware domain permission to use the IOMMU, which is a prerequisite for device passthrough.

---
 README.md                | 6 ++++++
 scripts/uboot-script-gen | 5 +++++
 2 files changed, 11 insertions(+)
README.md +6 -0
index 0063747..983cbbc 100644
@@ -338,6 +338,12 @@ Where:
       assigned to a regular DomU.
     - An explicit non-zero ID cannot be assigned to the hardware domain itself.
 
+- DOMU_PASSTHROUGH_PROP[number] is optional string used to permit a non-hardware
+  domain to use the IOMMU, which is a prerequisite for device passthrough.
+  If set to "enabled", the passthrough = "enabled"; property is added to
+  the domain's device tree node. This option has no effect if the IOMMU is not
+  active.
+
 - LINUX is optional but specifies the Linux kernel for when Xen is NOT
   used.  To enable this set any LINUX\_\* variables and do NOT set the
   XEN variable.
scripts/uboot-script-gen +5 -0
index 78a731d..d18ac55 100755
@@ -509,6 +509,11 @@ function xen_device_tree_editing()
             dt_set "/chosen/domU$i" "domid" "int" "${DOMU_DOMID[$i]}"
         fi
 
+        if test "${DOMU_PASSTHROUGH_PROP[$i]}" = "enabled"
+        then
+            dt_set "/chosen/domU$i" "passthrough" "str" "enabled"
+        fi
+
         if test -n "${DOMU_SHARED_MEM[i]}"
         then
             add_device_tree_static_shared_mem "/chosen/domU${i}" "${DOMU_SHARED_MEM[i]}"
Signature · 1 line
2.34.1