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.

Signed-off-by: Oleksandr Tyshchenko <[email protected]>
---
 README.md                | 6 ++++++
 scripts/uboot-script-gen | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/README.md b/README.md
index 2efac97..7ec7e7c 100644
--- a/README.md
+++ b/README.md
@@ -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.
diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
index e319de8..7912cc7 100755
--- a/scripts/uboot-script-gen
+++ b/scripts/uboot-script-gen
@@ -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]}"
-- 
2.34.1

Reply via email to