Skip to contentSkip to conversation

Add DOMU_TRAP_UNMAP parameter to control unmapped access behavior

PATCH In review Oleksandr Tyshchenko 2 participants 2 messages Nov 11, 2025 – Nov 12, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add DOMU_TRAP_UNMAP parameter to control unmapped access behavior

Introduce a new Arm-specific DOMU_TRAP_UNMAP parameter that allows configuring how Xen handles domain accesses to unmapped address ranges. This parameter corresponds to the "trap-unmapped-accesses" device tree property.

---
 README.md                | 6 ++++++
 scripts/uboot-script-gen | 5 +++++
 2 files changed, 11 insertions(+)
README.md +6 -0
index 2efac97..7ec7e7c 100644
@@ -319,6 +319,12 @@ Where:
   2: Hardware
   4: Xenstore
 
+- DOMU_TRAP_UNMAP[number] is an Arm-only option that configures handling of
+  domain accesses to unmapped address ranges. It is optional and has no effect
+  on x86. If set to 0, domain reads will return all bits as ones corresponding
+  to the access size and writes will be ignored. If set to 1, such accesses will
+  trap. The default is 1 when not specified.
+
 - 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 e319de8..7912cc7 100755
@@ -493,6 +493,11 @@ function xen_device_tree_editing()
             dt_set "/chosen/domU$i" "capabilities" "int" "$caps"
         fi
 
+        if test -n "${DOMU_TRAP_UNMAP[$i]}" && (test "${DOMU_TRAP_UNMAP[$i]}" -eq "0" || test "${DOMU_TRAP_UNMAP[$i]}" -eq "1")
+        then
+            dt_set "/chosen/domU$i" "trap-unmapped-accesses" "int" "${DOMU_TRAP_UNMAP[$i]}"
+        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