]>
xen/arm: dom0less: Add trap-unmapped-accesses
authorEdgar E. Iglesias <edgar.iglesias@amd.com>
Mon, 16 Jun 2025 15:38:23 +0000 (17:38 +0200)
committerStefano Stabellini <stefano.stabellini@amd.com>
Tue, 17 Jun 2025 17:59:04 +0000 (10:59 -0700)
Add the trap-unmapped-accesses per-domain fdt property.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
docs/misc/arm/device-tree/booting.txt
xen/arch/arm/dom0less-build.c

index 59fa96a82e0802213ad0d661114b317d47f2ea10..07acc7ba64f7ba0eae017ef52c20f77cd937f686 100644 (file)
@@ -225,6 +225,16 @@ with the following properties:
     option is provided with a non zero value, but the platform doesn't support
     SVE.
 
+- trap-unmapped-accesses
+
+    Optional. An integer that configures handling of accesses to unmapped
+    address ranges.
+    If set to 0, guest accesses will read all bits as ones, e.g 0xFFFFFFFF
+    for a 32bit access and writes will be ignored.
+    If set to 1, guest accesses will trap.
+
+    The default is 1 when trap-unmapped-accesses is absent.
+
 - xen,enhanced
 
     A string property. Possible property values are:
index 981af5079fef2c40d658567442aab5cb8c4bd062..4b285cff5ee2bbd32d5103bb7b9474d8ba3bda37 100644 (file)
@@ -344,8 +344,15 @@ void __init arch_create_domUs(struct dt_device_node *node,
 #endif
     }
 
-    /* Trap accesses to unmapped areas. */
+    /* Trap unmapped accesses by default. */
     d_cfg->flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
+    if ( dt_property_read_u32(node, "trap-unmapped-accesses", &val) )
+    {
+        if ( val > 1 )
+            panic("trap-unmapped-accesses: supported values are 0 or 1");
+        if ( !val )
+            d_cfg->flags &= ~XEN_DOMCTL_CDF_trap_unmapped_accesses;
+    }
 }
 
 int __init init_intc_phandle(struct kernel_info *kinfo, const char *name,