Skip to contentSkip to conversation

xen/arm: Add option to optionally disable trapping on unmapped acceses

PATCH Superseded Edgar E. Iglesias 6 participants 19 messages May 30, 2025 – Jun 3, 2025

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover xen/arm: Add option to optionally disable trapping on unmapped acceses

From: "Edgar E. Iglesias" <[email protected]>

This follows up on the virtio-pci discussion and adds a per-domain option to select the behaviour of accesses to unmapped address ranges. The new option is trap_unmapped_accesses, it's general but for now only implemented for ARM.

I'm happy with any name, so if you have better ideas please suggest them!

I've included regenerated golang bindings as a separate patch. We can drop it if it's not needed.

Thanks,
Edgar

ChangeLog:

v2 -> v3:
* Reword descriptions to clarify reads of all bits as ones.
* Use GENMASK as GENMASK_ULL not needed
* Style fix in if/else
* Regenerate golang bindings
* Update ocaml bindings

v1 -> v2:
* Rename trap_unmapped_mmio to trap_unmapped_accesses
* Generalize to allow other archs to later support this option
* Change dom0less DT binding from boolean to integer
* Remove changes to autogenerated go bindings

Edgar E. Iglesias (5):
xen/arm: Add way to disable traps on accesses to unmapped addresses xen/arm: dom0less: Add trap-unmapped-accesses
tools/arm: Add the trap_unmapped_accesses xl config option tools/ocaml: Update bindings for CDF_TRAP_UNMAPPED_ACCESSES tools/golang: Regenerate bindings for trap_unmapped_accesses

 docs/man/xl.cfg.5.pod.in              |  9 +++++++
 docs/misc/arm/device-tree/booting.txt | 10 ++++++++
 tools/golang/xenlight/helpers.gen.go  |  6 +++++
 tools/golang/xenlight/types.gen.go    |  1 +
 tools/libs/light/libxl_arm.c          |  3 +++
 tools/libs/light/libxl_create.c       |  3 +++
 tools/libs/light/libxl_types.idl      |  1 +
 tools/libs/light/libxl_x86.c          |  6 +++++
 tools/ocaml/libs/xc/xenctrl.ml        |  1 +
 tools/ocaml/libs/xc/xenctrl.mli       |  1 +
 tools/xl/xl_parse.c                   |  3 +++
 xen/arch/arm/dom0less-build.c         | 10 ++++++++
 xen/arch/arm/domain.c                 |  3 ++-
 xen/arch/arm/domain_build.c           |  3 ++-
 xen/arch/arm/io.c                     | 37 +++++++++++++++++++++++++--
 xen/common/domain.c                   |  3 ++-
 xen/include/public/domctl.h           |  4 ++-
 17 files changed, 98 insertions(+), 6 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v3 1/5 xen/arm: Add way to disable traps on accesses to unmapped addresses

From: "Edgar E. Iglesias" <[email protected]>

Add a per-domain way to optionally disable traps for accesses to unmapped addresses.

The domain flag is general but it's only implemented for ARM for now.

---
 tools/libs/light/libxl_arm.c  |  3 +++
 xen/arch/arm/dom0less-build.c |  3 +++
 xen/arch/arm/domain.c         |  3 ++-
 xen/arch/arm/domain_build.c   |  3 ++-
 xen/arch/arm/io.c             | 37 +++++++++++++++++++++++++++++++++--
 xen/common/domain.c           |  3 ++-
 xen/include/public/domctl.h   |  4 +++-
 7 files changed, 50 insertions(+), 6 deletions(-)
tools/libs/light/libxl_arm.c +3 -0
index 75c811053c..9530996e72 100644
@@ -233,6 +233,9 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
         config->arch.sve_vl = d_config->b_info.arch_arm.sve_vl / 128U;
     }
 
+    /* Trap accesses to unmapped areas. */
+    config->flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
+
     return 0;
 }
 
xen/arch/arm/dom0less-build.c +3 -0
index a49764f0ad..a4e0a33632 100644
@@ -343,6 +343,9 @@ void __init arch_create_domUs(struct dt_device_node *node,
         panic("'sve' property found, but CONFIG_ARM64_SVE not selected\n");
 #endif
     }
+
+    /* Trap accesses to unmapped areas. */
+    d_cfg->flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
 }
 
 int __init init_intc_phandle(struct kernel_info *kinfo, const char *name,
xen/arch/arm/domain.c +2 -1
index 45aeb8bddc..be58a23dd7 100644
@@ -612,7 +612,8 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
     unsigned int max_vcpus;
     unsigned int flags_required = (XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap);
     unsigned int flags_optional = (XEN_DOMCTL_CDF_iommu | XEN_DOMCTL_CDF_vpmu |
-                                   XEN_DOMCTL_CDF_xs_domain );
+                                   XEN_DOMCTL_CDF_xs_domain |
+                                   XEN_DOMCTL_CDF_trap_unmapped_accesses );
     unsigned int sve_vl_bits = sve_decode_vl(config->arch.sve_vl);
 
     if ( (config->flags & ~flags_optional) != flags_required )
xen/arch/arm/domain_build.c +2 -1
index b189a7cfae..7ff9c1b584 100644
@@ -2003,7 +2003,8 @@ void __init create_dom0(void)
 {
     struct domain *dom0;
     struct xen_domctl_createdomain dom0_cfg = {
-        .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
+        .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap |
+                 XEN_DOMCTL_CDF_trap_unmapped_accesses,
         .max_evtchn_port = -1,
         .max_grant_frames = gnttab_dom0_frames(),
         .max_maptrack_frames = -1,
xen/arch/arm/io.c +35 -2
index 5a4b0e8f25..e599bbe043 100644
@@ -21,6 +21,32 @@
 
 #include "decode.h"
 
+/* Handler for unmapped ranges. Writes ignored, reads return all ones.  */
+static int unmapped_read(struct vcpu *v, mmio_info_t *info, register_t *r,
+                         void *priv)
+{
+    uint64_t mask = GENMASK((1U << info->dabt.size) * 8 - 1, 0);
+
+    /* Mask off upper bits.  */
+    *r = UINT64_MAX & mask;
+    return 1;
+}
+
+static int unmapped_write(struct vcpu *v, mmio_info_t *info, register_t r,
+                          void *priv)
+{
+    return 1;
+}
+
+static const struct mmio_handler_ops unmapped_ops = {
+    .read = unmapped_read,
+    .write = unmapped_write
+};
+
+static const struct mmio_handler unmapped_handler = {
+    .ops = &unmapped_ops
+};
+
 static enum io_state handle_read(const struct mmio_handler *handler,
                                  struct vcpu *v,
                                  mmio_info_t *info)
@@ -175,11 +201,18 @@ enum io_state try_handle_mmio(struct cpu_user_regs *regs,
     handler = find_mmio_handler(v->domain, info->gpa);
     if ( !handler )
     {
+        bool trap_unmapped = v->domain->options &
+                                         XEN_DOMCTL_CDF_trap_unmapped_accesses;
         rc = try_fwd_ioserv(regs, v, info);
         if ( rc == IO_HANDLED )
             return handle_ioserv(regs, v);
-
-        return rc;
+        else if ( rc == IO_UNHANDLED && !trap_unmapped )
+        {
+            /* Fallback to the unmapped handler. */
+            handler = &unmapped_handler;
+        } else {
+            return rc;
+        }
     }
 
     /*
xen/common/domain.c +2 -1
index abf1969e60..ac4f58f638 100644
@@ -721,7 +721,8 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
          ~(XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap |
            XEN_DOMCTL_CDF_s3_integrity | XEN_DOMCTL_CDF_oos_off |
            XEN_DOMCTL_CDF_xs_domain | XEN_DOMCTL_CDF_iommu |
-           XEN_DOMCTL_CDF_nested_virt | XEN_DOMCTL_CDF_vpmu) )
+           XEN_DOMCTL_CDF_nested_virt | XEN_DOMCTL_CDF_vpmu |
+           XEN_DOMCTL_CDF_trap_unmapped_accesses) )
     {
         dprintk(XENLOG_INFO, "Unknown CDF flags %#x\n", config->flags);
         return -EINVAL;
xen/include/public/domctl.h +3 -1
index 5b2063eed9..be19ab5e26 100644
@@ -66,9 +66,11 @@ struct xen_domctl_createdomain {
 #define XEN_DOMCTL_CDF_nested_virt    (1U << _XEN_DOMCTL_CDF_nested_virt)
 /* Should we expose the vPMU to the guest? */
 #define XEN_DOMCTL_CDF_vpmu           (1U << 7)
+/* Should we trap guest accesses to unmapped addresses? */
+#define XEN_DOMCTL_CDF_trap_unmapped_accesses  (1U << 8)
 
 /* Max XEN_DOMCTL_CDF_* constant.  Used for ABI checking. */
-#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_vpmu
+#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_trap_unmapped_accesses
 
     uint32_t flags;
 
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v3 1/5] xen/arm: Add way to disable traps on accesses to unmapped addresses

Quoted 15 lines · Edgar E. Iglesias
xen/common/domain.c +2 -1
@@ -721,7 +721,8 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
          ~(XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap |
            XEN_DOMCTL_CDF_s3_integrity | XEN_DOMCTL_CDF_oos_off |
            XEN_DOMCTL_CDF_xs_domain | XEN_DOMCTL_CDF_iommu |
-           XEN_DOMCTL_CDF_nested_virt | XEN_DOMCTL_CDF_vpmu) )
+           XEN_DOMCTL_CDF_nested_virt | XEN_DOMCTL_CDF_vpmu |
+           XEN_DOMCTL_CDF_trap_unmapped_accesses) )
     {
         dprintk(XENLOG_INFO, "Unknown CDF flags %#x\n", config->flags);
         return -EINVAL;

xen/include/public/domctl.h struct xen_domctl_createdomain { · line 70

Quoted 5 lines
xen/include/public/domctl.h +2 -0
@@ -66,9 +66,11 @@ struct xen_domctl_createdomain {
 #define XEN_DOMCTL_CDF_nested_virt    (1U << _XEN_DOMCTL_CDF_nested_virt)
 /* Should we expose the vPMU to the guest? */
 #define XEN_DOMCTL_CDF_vpmu           (1U << 7)
+/* Should we trap guest accesses to unmapped addresses? */
+#define XEN_DOMCTL_CDF_trap_unmapped_accesses  (1U << 8)

Besides being pretty long an identifier (and that's already with "guest" not even in the name), if this is to be arch-independent, would this perhaps fit x86'es recently introduced "advanced" PVH handling of holes? See [1].

Jan

[1] 104591f5dd67 ("x86/dom0: attempt to fixup p2m page-faults for PVH dom0")

#3 lore raw

Re: [PATCH v3 1/5] xen/arm: Add way to disable traps on accesses to unmapped addresses

Quoted 17 lines · Jan Beulich
Quoted 16 lines · Edgar E. Iglesias
xen/common/domain.c +2 -1
@@ -721,7 +721,8 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
          ~(XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap |
            XEN_DOMCTL_CDF_s3_integrity | XEN_DOMCTL_CDF_oos_off |
            XEN_DOMCTL_CDF_xs_domain | XEN_DOMCTL_CDF_iommu |
-           XEN_DOMCTL_CDF_nested_virt | XEN_DOMCTL_CDF_vpmu) )
+           XEN_DOMCTL_CDF_nested_virt | XEN_DOMCTL_CDF_vpmu |
+           XEN_DOMCTL_CDF_trap_unmapped_accesses) )
     {
         dprintk(XENLOG_INFO, "Unknown CDF flags %#x\n", config->flags);
         return -EINVAL;
xen/include/public/domctl.h +0 -0
@@ -66,9 +66,11 @@ struct xen_domctl_createdomain {
 #define XEN_DOMCTL_CDF_nested_virt    (1U << _XEN_DOMCTL_CDF_nested_virt)
Quoted 9 lines

xen/include/public/domctl.h struct xen_domctl_createdomain { · line 70

Quoted 4 lines
xen/include/public/domctl.h +2 -0
 /* Should we expose the vPMU to the guest? */
 #define XEN_DOMCTL_CDF_vpmu           (1U << 7)
+/* Should we trap guest accesses to unmapped addresses? */
+#define XEN_DOMCTL_CDF_trap_unmapped_accesses  (1U << 8)

Besides being pretty long an identifier (and that's already with "guest" not even in the name), if this is to be arch-independent, would this perhaps fit x86'es recently introduced "advanced" PVH handling of holes? See [1].

Looks like the implementation of the options would be related but trap_unmapped_accesses is intended for domU's and pf-fixup is for dom0 IIUC, so in terms of configuration they would be different...

I'm happy to change the name of trap_unmapped_accesses if there are better (and shorter) ideas.

Thanks,
Edgar

Quoted 3 lines

Jan

[1] 104591f5dd67 ("x86/dom0: attempt to fixup p2m page-faults for PVH dom0")

Reviewed-by on v3 1/5
#4 lore raw

Re: [PATCH v3 1/5] xen/arm: Add way to disable traps on accesses to unmapped addresses

In reply to Edgar E. Iglesias
Quoted 8 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Add a per-domain way to optionally disable traps for accesses to unmapped addresses.

The domain flag is general but it's only implemented for ARM for now.

I am OK with the name "XEN_DOMCTL_CDF_trap_unmapped_accesses" being long but I would also be OK with a shorter name if it is still clear enough.

#5 lore raw

Re: [PATCH v3 1/5] xen/arm: Add way to disable traps on accesses to unmapped addresses

In reply to Edgar E. Iglesias

Hi Edgar,

Quoted 51 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Add a per-domain way to optionally disable traps for accesses to unmapped addresses.

The domain flag is general but it's only implemented for ARM for now.

---
  tools/libs/light/libxl_arm.c  |  3 +++
  xen/arch/arm/dom0less-build.c |  3 +++
  xen/arch/arm/domain.c         |  3 ++-
  xen/arch/arm/domain_build.c   |  3 ++-
  xen/arch/arm/io.c             | 37 +++++++++++++++++++++++++++++++++--
  xen/common/domain.c           |  3 ++-
  xen/include/public/domctl.h   |  4 +++-
  7 files changed, 50 insertions(+), 6 deletions(-)
tools/libs/light/libxl_arm.c +3 -0
index 75c811053c..9530996e72 100644
@@ -233,6 +233,9 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
          config->arch.sve_vl = d_config->b_info.arch_arm.sve_vl / 128U;
      }
 
+    /* Trap accesses to unmapped areas. */
+    config->flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
+
      return 0;
  }
 
xen/arch/arm/dom0less-build.c +3 -0
index a49764f0ad..a4e0a33632 100644
@@ -343,6 +343,9 @@ void __init arch_create_domUs(struct dt_device_node *node,
          panic("'sve' property found, but CONFIG_ARM64_SVE not selected\n");
  #endif
      }
+
+    /* Trap accesses to unmapped areas. */
+    d_cfg->flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
  }
 
  int __init init_intc_phandle(struct kernel_info *kinfo, const char *name,
xen/arch/arm/domain.c +0 -0
index 45aeb8bddc..be58a23dd7 100644

xen/arch/arm/domain.c int arch_sanitise_domain_config(struct xen_domctl_createdomain *config) · line 616

Quoted 6 lines
xen/arch/arm/domain.c +2 -1
@@ -612,7 +612,8 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
      unsigned int max_vcpus;
      unsigned int flags_required = (XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap);
      unsigned int flags_optional = (XEN_DOMCTL_CDF_iommu | XEN_DOMCTL_CDF_vpmu |
-                                   XEN_DOMCTL_CDF_xs_domain );
+                                   XEN_DOMCTL_CDF_xs_domain |
+                                   XEN_DOMCTL_CDF_trap_unmapped_accesses );

Just to double check, doesn't this mean the flag will be allowed on x86? If so, shouldn't we reject it in an arch?

Cheers,

Signature · 1 line
Julien Grall
#6 lore raw

Re: [PATCH v3 1/5] xen/arm: Add way to disable traps on accesses to unmapped addresses

Quoted 1 line · Julien Grall

Hi Edgar,

Hi Julien,

Quoted 51 lines · Edgar E. Iglesias
Quoted 49 lines

From: "Edgar E. Iglesias" <[email protected]>

Add a per-domain way to optionally disable traps for accesses to unmapped addresses.

The domain flag is general but it's only implemented for ARM for now.

---
  tools/libs/light/libxl_arm.c  |  3 +++
  xen/arch/arm/dom0less-build.c |  3 +++
  xen/arch/arm/domain.c         |  3 ++-
  xen/arch/arm/domain_build.c   |  3 ++-
  xen/arch/arm/io.c             | 37 +++++++++++++++++++++++++++++++++--
  xen/common/domain.c           |  3 ++-
  xen/include/public/domctl.h   |  4 +++-
  7 files changed, 50 insertions(+), 6 deletions(-)
tools/libs/light/libxl_arm.c +3 -0
index 75c811053c..9530996e72 100644
@@ -233,6 +233,9 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
          config->arch.sve_vl = d_config->b_info.arch_arm.sve_vl / 128U;
      }
+    /* Trap accesses to unmapped areas. */
+    config->flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
+
      return 0;
  }
xen/arch/arm/dom0less-build.c +3 -0
index a49764f0ad..a4e0a33632 100644
@@ -343,6 +343,9 @@ void __init arch_create_domUs(struct dt_device_node *node,
          panic("'sve' property found, but CONFIG_ARM64_SVE not selected\n");
  #endif
      }
+
+    /* Trap accesses to unmapped areas. */
+    d_cfg->flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
  }
  int __init init_intc_phandle(struct kernel_info *kinfo, const char *name,
xen/arch/arm/domain.c +0 -0
index 45aeb8bddc..be58a23dd7 100644
@@ -612,7 +612,8 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
      unsigned int max_vcpus;
Quoted 8 lines

xen/arch/arm/domain.c int arch_sanitise_domain_config(struct xen_domctl_createdomain *config) · line 616

Quoted 5 lines
xen/arch/arm/domain.c +2 -1
      unsigned int flags_required = (XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap);
      unsigned int flags_optional = (XEN_DOMCTL_CDF_iommu | XEN_DOMCTL_CDF_vpmu |
-                                   XEN_DOMCTL_CDF_xs_domain );
+                                   XEN_DOMCTL_CDF_xs_domain |
+                                   XEN_DOMCTL_CDF_trap_unmapped_accesses );

Just to double check, doesn't this mean the flag will be allowed on x86? If so, shouldn't we reject it in an arch?

Yes, I had initially thought I could block the flag for x86 in xl but I didn't consider go/ocaml bindings nor Xen internal missconfig. In v4, I'm adding a check in x86's arch_sanitise_domain_config().

Cheers,
Edgar

Quoted 6 lines

Cheers,

Signature · 1 line
Julien Grall
#7 lore raw

PATCH v3 2/5 xen/arm: dom0less: Add trap-unmapped-accesses

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Add the trap-unmapped-accesses per-domain fdt property.

---
 docs/misc/arm/device-tree/booting.txt | 10 ++++++++++
 xen/arch/arm/dom0less-build.c         |  9 ++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)
docs/misc/arm/device-tree/booting.txt +10 -0
index 59fa96a82e..9add6440de 100644
@@ -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.
+
+    This option is only implemented for ARM where the default is 1.
+
 - xen,enhanced
 
     A string property. Possible property values are:
xen/arch/arm/dom0less-build.c +8 -1
index a4e0a33632..69324aa597 100644
@@ -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,
Signature · 1 line
2.43.0
Reviewed-by on v3 2/5
#8 lore raw

Re: [PATCH v3 2/5] xen/arm: dom0less: Add trap-unmapped-accesses

Quoted 17 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Add the trap-unmapped-accesses per-domain fdt property.

---
 docs/misc/arm/device-tree/booting.txt | 10 ++++++++++
 xen/arch/arm/dom0less-build.c         |  9 ++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)
docs/misc/arm/device-tree/booting.txt +0 -0
index 59fa96a82e..9add6440de 100644
@@ -225,6 +225,16 @@ with the following properties:
     option is provided with a non zero value, but the platform doesn't support
     SVE.

docs/misc/arm/device-tree/booting.txt with the following properties: · line 236

Quoted 10 lines
docs/misc/arm/device-tree/booting.txt +9 -0
 
+- 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.
+
+    This option is only implemented for ARM where the default is 1.

Please expand it to: "This option is only implemented for ARM where the default is 1 when trap-unmapped-accesses is absent."

The change could be done on commit:

Quoted 27 lines
docs/misc/arm/device-tree/booting.txt +0 -0
 - xen,enhanced
 
     A string property. Possible property values are:
xen/arch/arm/dom0less-build.c +8 -1
index a4e0a33632..69324aa597 100644
@@ -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,
Signature · 1 line
2.43.0
#9 lore raw

Re: [PATCH v3 2/5] xen/arm: dom0less: Add trap-unmapped-accesses

Hi,

Quoted 19 lines · Stefano Stabellini
Quoted 18 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Add the trap-unmapped-accesses per-domain fdt property.

---
  docs/misc/arm/device-tree/booting.txt | 10 ++++++++++
  xen/arch/arm/dom0less-build.c         |  9 ++++++++-
  2 files changed, 18 insertions(+), 1 deletion(-)
docs/misc/arm/device-tree/booting.txt +0 -0
index 59fa96a82e..9add6440de 100644
@@ -225,6 +225,16 @@ with the following properties:
      option is provided with a non zero value, but the platform doesn't support
      SVE.
 
Quoted 12 lines

docs/misc/arm/device-tree/booting.txt with the following properties: · line 236

Quoted 9 lines
docs/misc/arm/device-tree/booting.txt +9 -0
+- 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.
+
+    This option is only implemented for ARM where the default is 1.

Please expand it to: "This option is only implemented for ARM where the default is 1 when trap-unmapped-accesses is absent."

I am confused. The document is part of "docs/misc/arm" and some options like "sve" are Arm specific. We don't mention this is Arm only because the documention is Arm specific.

I know that RISC-V is starting to share the bindings. So really (part of) the documentation should be moved to common. Until then, I think it is misleading to add "is only implemented for ARM".

BTW, the spelling for should be "Arm" ;).

Cheers,

Signature · 1 line
Julien Grall
#10 lore raw

Re: [PATCH v3 2/5] xen/arm: dom0less: Add trap-unmapped-accesses

Quoted 37 lines · Julien Grall

Hi,

Quoted 25 lines · Stefano Stabellini
Quoted 24 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Add the trap-unmapped-accesses per-domain fdt property.

---
  docs/misc/arm/device-tree/booting.txt | 10 ++++++++++
  xen/arch/arm/dom0less-build.c         |  9 ++++++++-
  2 files changed, 18 insertions(+), 1 deletion(-)
docs/misc/arm/device-tree/booting.txt +0 -0
index 59fa96a82e..9add6440de 100644
@@ -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

docs/misc/arm/device-tree/booting.txt +4 -0
+
+    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
Quoted 8 lines

docs/misc/arm/device-tree/booting.txt with the following properties: · line 236

Quoted 5 lines

0xFFFFFFFF

docs/misc/arm/device-tree/booting.txt +4 -0
+    for a 32bit access and writes will be ignored.
+    If set to 1, guest accesses will trap.
+
+    This option is only implemented for ARM where the default is 1.

Please expand it to: "This option is only implemented for ARM where the default is 1 when trap-unmapped-accesses is absent."

Quoted 7 lines

I am confused. The document is part of "docs/misc/arm" and some options like "sve" are Arm specific. We don't mention this is Arm only because the documention is Arm specific.

I know that RISC-V is starting to share the bindings. So really (part of) the documentation should be moved to common. Until then, I think it is misleading to add "is only implemented for ARM".

Yes you are right. Maybe Oleksii or Alejandro can fix this, moving this file to common.

For this smaller patch series, I would remove the "is only implemented for ARM".

Quoted 1 line

BTW, the spelling for should be "Arm" ;).

:-)

#11 lore raw

Re: [PATCH v3 2/5] xen/arm: dom0less: Add trap-unmapped-accesses

Quoted 46 lines · Stefano Stabellini
Quoted 37 lines · Julien Grall

Hi,

Quoted 25 lines · Stefano Stabellini
Quoted 24 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Add the trap-unmapped-accesses per-domain fdt property.

---
  docs/misc/arm/device-tree/booting.txt | 10 ++++++++++
  xen/arch/arm/dom0less-build.c         |  9 ++++++++-
  2 files changed, 18 insertions(+), 1 deletion(-)
docs/misc/arm/device-tree/booting.txt +0 -0
index 59fa96a82e..9add6440de 100644
@@ -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

docs/misc/arm/device-tree/booting.txt +4 -0
+
+    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
Quoted 8 lines

docs/misc/arm/device-tree/booting.txt with the following properties: · line 236

Quoted 5 lines

0xFFFFFFFF

docs/misc/arm/device-tree/booting.txt +4 -0
+    for a 32bit access and writes will be ignored.
+    If set to 1, guest accesses will trap.
+
+    This option is only implemented for ARM where the default is 1.

Please expand it to: "This option is only implemented for ARM where the default is 1 when trap-unmapped-accesses is absent."

Quoted 7 lines

I am confused. The document is part of "docs/misc/arm" and some options like "sve" are Arm specific. We don't mention this is Arm only because the documention is Arm specific.

I know that RISC-V is starting to share the bindings. So really (part of) the documentation should be moved to common. Until then, I think it is misleading to add "is only implemented for ARM".

Quoted 5 lines

Yes you are right. Maybe Oleksii or Alejandro can fix this, moving this file to common.

For this smaller patch series, I would remove the "is only implemented for ARM".

Thanks, I've changed that line to:
"The default is 1 when trap-unmapped-accesses is absent."

Cheers,
Edgar

#12 lore raw

PATCH v3 3/5 tools/arm: Add the trap_unmapped_accesses xl config option

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

---
 docs/man/xl.cfg.5.pod.in         | 9 +++++++++
 tools/libs/light/libxl_arm.c     | 6 +++---
 tools/libs/light/libxl_create.c  | 3 +++
 tools/libs/light/libxl_types.idl | 1 +
 tools/libs/light/libxl_x86.c     | 6 ++++++
 tools/xl/xl_parse.c              | 3 +++
 6 files changed, 25 insertions(+), 3 deletions(-)
docs/man/xl.cfg.5.pod.in +9 -0
index 7339c44efd..6c303e8efa 100644
@@ -3089,6 +3089,15 @@ will be used for the domain. Otherwise, the value specified by the `nr_spis`
 parameter will be used. The number of SPIs should match the highest interrupt
 ID that will be assigned to the domain.
 
+=item B<trap_unmapped_accesses=BOOLEAN>
+
+An Optional boolean parameter that configures handling of accesses to unmapped
+address ranges. If enabled, guest accesses will trap. If disabled, guest
+accesses will read all bits as ones, e.g 0xFFFFFFFF for a 32bit access and
+writes will be ignored.
+
+This option is only implemented for ARM where the default is enabled.
+
 =back
 
 =head3 x86
tools/libs/light/libxl_arm.c +3 -3
index 9530996e72..afc62a5299 100644
@@ -233,9 +233,6 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
         config->arch.sve_vl = d_config->b_info.arch_arm.sve_vl / 128U;
     }
 
-    /* Trap accesses to unmapped areas. */
-    config->flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
-
     return 0;
 }
 
@@ -1714,6 +1711,9 @@ int libxl__arch_domain_build_info_setdefault(libxl__gc *gc,
     /* ACPI is disabled by default */
     libxl_defbool_setdefault(&b_info->acpi, false);
 
+    /* Trapping of unmapped accesses enabled by default.  */
+    libxl_defbool_setdefault(&b_info->trap_unmapped_accesses, true);
+
     /* Sanitise SVE parameter */
     if (b_info->arch_arm.sve_vl) {
         unsigned int max_sve_vl =
tools/libs/light/libxl_create.c +3 -0
index e03599ea99..38770eea5b 100644
@@ -667,6 +667,9 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
         if (libxl_defbool_val(b_info->vpmu))
             create.flags |= XEN_DOMCTL_CDF_vpmu;
 
+        if (libxl_defbool_val(b_info->trap_unmapped_accesses))
+            create.flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
+
         assert(info->passthrough != LIBXL_PASSTHROUGH_DEFAULT);
         LOG(DETAIL, "passthrough: %s",
             libxl_passthrough_to_string(info->passthrough));
tools/libs/light/libxl_types.idl +1 -0
index 9bb2969931..e33785c661 100644
@@ -736,6 +736,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("vmtrace_buf_kb", integer),
 
     ("vpmu", libxl_defbool),
+    ("trap_unmapped_accesses", libxl_defbool),
 
     ], dir=DIR_IN,
        copy_deprecated_fn="libxl__domain_build_info_copy_deprecated",
tools/libs/light/libxl_x86.c +6 -0
index 0b1c2d3a96..a9d470c9f6 100644
@@ -26,6 +26,11 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
     if (libxl_defbool_val(d_config->b_info.arch_x86.msr_relaxed))
         config->arch.misc_flags |= XEN_X86_MSR_RELAXED;
 
+    if (libxl_defbool_val(d_config->b_info.trap_unmapped_accesses)) {
+            LOG(ERROR, "trap_unmapped_accesses is not supported on x86\n");
+            return ERROR_FAIL;
+    }
+
     return 0;
 }
 
@@ -813,6 +818,7 @@ int libxl__arch_domain_build_info_setdefault(libxl__gc *gc,
 {
     libxl_defbool_setdefault(&b_info->acpi, true);
     libxl_defbool_setdefault(&b_info->arch_x86.msr_relaxed, false);
+    libxl_defbool_setdefault(&b_info->trap_unmapped_accesses, false);
 
     /*
      * The config parameter "altp2m" replaces the parameter "altp2mhvm".
tools/xl/xl_parse.c +3 -0
index 089a88935a..40da75ef74 100644
@@ -2975,6 +2975,9 @@ skip_usbdev:
     if (!xlu_cfg_get_long (config, "nr_spis", &l, 0))
         b_info->arch_arm.nr_spis = l;
 
+    xlu_cfg_get_defbool(config, "trap_unmapped_accesses",
+                        &b_info->trap_unmapped_accesses, 0);
+
     parse_vkb_list(config, d_config);
 
     d_config->virtios = NULL;
Signature · 1 line
2.43.0
Reviewed-by on v3 3/5
#13 lore raw

Re: [PATCH v3 3/5] tools/arm: Add the trap_unmapped_accesses xl config option

Quoted 3 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Quoted 120 lines
---
 docs/man/xl.cfg.5.pod.in         | 9 +++++++++
 tools/libs/light/libxl_arm.c     | 6 +++---
 tools/libs/light/libxl_create.c  | 3 +++
 tools/libs/light/libxl_types.idl | 1 +
 tools/libs/light/libxl_x86.c     | 6 ++++++
 tools/xl/xl_parse.c              | 3 +++
 6 files changed, 25 insertions(+), 3 deletions(-)
docs/man/xl.cfg.5.pod.in +9 -0
index 7339c44efd..6c303e8efa 100644
@@ -3089,6 +3089,15 @@ will be used for the domain. Otherwise, the value specified by the `nr_spis`
 parameter will be used. The number of SPIs should match the highest interrupt
 ID that will be assigned to the domain.
 
+=item B<trap_unmapped_accesses=BOOLEAN>
+
+An Optional boolean parameter that configures handling of accesses to unmapped
+address ranges. If enabled, guest accesses will trap. If disabled, guest
+accesses will read all bits as ones, e.g 0xFFFFFFFF for a 32bit access and
+writes will be ignored.
+
+This option is only implemented for ARM where the default is enabled.
+
 =back
 
 =head3 x86
tools/libs/light/libxl_arm.c +3 -3
index 9530996e72..afc62a5299 100644
@@ -233,9 +233,6 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
         config->arch.sve_vl = d_config->b_info.arch_arm.sve_vl / 128U;
     }
 
-    /* Trap accesses to unmapped areas. */
-    config->flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
-
     return 0;
 }
 
@@ -1714,6 +1711,9 @@ int libxl__arch_domain_build_info_setdefault(libxl__gc *gc,
     /* ACPI is disabled by default */
     libxl_defbool_setdefault(&b_info->acpi, false);
 
+    /* Trapping of unmapped accesses enabled by default.  */
+    libxl_defbool_setdefault(&b_info->trap_unmapped_accesses, true);
+
     /* Sanitise SVE parameter */
     if (b_info->arch_arm.sve_vl) {
         unsigned int max_sve_vl =
tools/libs/light/libxl_create.c +3 -0
index e03599ea99..38770eea5b 100644
@@ -667,6 +667,9 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
         if (libxl_defbool_val(b_info->vpmu))
             create.flags |= XEN_DOMCTL_CDF_vpmu;
 
+        if (libxl_defbool_val(b_info->trap_unmapped_accesses))
+            create.flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
+
         assert(info->passthrough != LIBXL_PASSTHROUGH_DEFAULT);
         LOG(DETAIL, "passthrough: %s",
             libxl_passthrough_to_string(info->passthrough));
tools/libs/light/libxl_types.idl +1 -0
index 9bb2969931..e33785c661 100644
@@ -736,6 +736,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("vmtrace_buf_kb", integer),
 
     ("vpmu", libxl_defbool),
+    ("trap_unmapped_accesses", libxl_defbool),
 
     ], dir=DIR_IN,
        copy_deprecated_fn="libxl__domain_build_info_copy_deprecated",
tools/libs/light/libxl_x86.c +6 -0
index 0b1c2d3a96..a9d470c9f6 100644
@@ -26,6 +26,11 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc,
     if (libxl_defbool_val(d_config->b_info.arch_x86.msr_relaxed))
         config->arch.misc_flags |= XEN_X86_MSR_RELAXED;
 
+    if (libxl_defbool_val(d_config->b_info.trap_unmapped_accesses)) {
+            LOG(ERROR, "trap_unmapped_accesses is not supported on x86\n");
+            return ERROR_FAIL;
+    }
+
     return 0;
 }
 
@@ -813,6 +818,7 @@ int libxl__arch_domain_build_info_setdefault(libxl__gc *gc,
 {
     libxl_defbool_setdefault(&b_info->acpi, true);
     libxl_defbool_setdefault(&b_info->arch_x86.msr_relaxed, false);
+    libxl_defbool_setdefault(&b_info->trap_unmapped_accesses, false);
 
     /*
      * The config parameter "altp2m" replaces the parameter "altp2mhvm".
tools/xl/xl_parse.c +3 -0
index 089a88935a..40da75ef74 100644
@@ -2975,6 +2975,9 @@ skip_usbdev:
     if (!xlu_cfg_get_long (config, "nr_spis", &l, 0))
         b_info->arch_arm.nr_spis = l;
 
+    xlu_cfg_get_defbool(config, "trap_unmapped_accesses",
+                        &b_info->trap_unmapped_accesses, 0);
+
     parse_vkb_list(config, d_config);
 
     d_config->virtios = NULL;
Signature · 1 line
2.43.0
#14 lore raw

Re: [PATCH v3 3/5] tools/arm: Add the trap_unmapped_accesses xl config option

In reply to Edgar E. Iglesias

Hi Edgar,

Quoted 29 lines · Edgar E. Iglesias
tools/libs/light/libxl_arm.c +3 -0
@@ -1714,6 +1711,9 @@ int libxl__arch_domain_build_info_setdefault(libxl__gc *gc,
      /* ACPI is disabled by default */
      libxl_defbool_setdefault(&b_info->acpi, false);
 
+    /* Trapping of unmapped accesses enabled by default.  */
+    libxl_defbool_setdefault(&b_info->trap_unmapped_accesses, true);
+
      /* Sanitise SVE parameter */
      if (b_info->arch_arm.sve_vl) {
          unsigned int max_sve_vl =
tools/libs/light/libxl_create.c +3 -0
index e03599ea99..38770eea5b 100644
@@ -667,6 +667,9 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
          if (libxl_defbool_val(b_info->vpmu))
              create.flags |= XEN_DOMCTL_CDF_vpmu;
 
+        if (libxl_defbool_val(b_info->trap_unmapped_accesses))
+            create.flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
+
          assert(info->passthrough != LIBXL_PASSTHROUGH_DEFAULT);
          LOG(DETAIL, "passthrough: %s",
              libxl_passthrough_to_string(info->passthrough));
tools/libs/light/libxl_types.idl +0 -0
index 9bb2969931..e33785c661 100644

tools/libs/light/libxl_types.idl libxl_domain_build_info = Struct("domain_build_info",[ · line 739

Quoted 4 lines
tools/libs/light/libxl_types.idl +1 -0
@@ -736,6 +736,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
      ("vmtrace_buf_kb", integer),
 
      ("vpmu", libxl_defbool),
+    ("trap_unmapped_accesses", libxl_defbool),

I think you want to add a LIBXL_HAVE in tools/include/libxl.h for this new field.

Cheers,

Signature · 1 line
Julien Grall
#15 lore raw

Re: [PATCH v3 3/5] tools/arm: Add the trap_unmapped_accesses xl config option

Quoted 28 lines · Julien Grall

Hi Edgar,

Quoted 25 lines · Edgar E. Iglesias
tools/libs/light/libxl_arm.c +3 -0
@@ -1714,6 +1711,9 @@ int libxl__arch_domain_build_info_setdefault(libxl__gc *gc,
      /* ACPI is disabled by default */
      libxl_defbool_setdefault(&b_info->acpi, false);
+    /* Trapping of unmapped accesses enabled by default.  */
+    libxl_defbool_setdefault(&b_info->trap_unmapped_accesses, true);
+
      /* Sanitise SVE parameter */
      if (b_info->arch_arm.sve_vl) {
          unsigned int max_sve_vl =
tools/libs/light/libxl_create.c +3 -0
index e03599ea99..38770eea5b 100644
@@ -667,6 +667,9 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
          if (libxl_defbool_val(b_info->vpmu))
              create.flags |= XEN_DOMCTL_CDF_vpmu;
+        if (libxl_defbool_val(b_info->trap_unmapped_accesses))
+            create.flags |= XEN_DOMCTL_CDF_trap_unmapped_accesses;
+
          assert(info->passthrough != LIBXL_PASSTHROUGH_DEFAULT);
          LOG(DETAIL, "passthrough: %s",
              libxl_passthrough_to_string(info->passthrough));
tools/libs/light/libxl_types.idl +0 -1
index 9bb2969931..e33785c661 100644
--- a/tools/libs/light/libxl_types.idl
Quoted 8 lines

tools/libs/light/libxl_types.idl libxl_domain_build_info = Struct("domain_build_info",[ · line 738

Quoted 5 lines

+++ b/tools/libs/light/libxl_types.idl

tools/libs/light/libxl_types.idl +1 -0
@@ -736,6 +736,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
      ("vmtrace_buf_kb", integer),
      ("vpmu", libxl_defbool),
+    ("trap_unmapped_accesses", libxl_defbool),

I think you want to add a LIBXL_HAVE in tools/include/libxl.h for this new field.

Thanks, adding it in v4.

Quoted 6 lines

Cheers,

Signature · 1 line
Julien Grall
#16 lore raw

PATCH v3 4/5 tools/ocaml: Update bindings for CDF_TRAP_UNMAPPED_ACCESSES

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

---
 tools/ocaml/libs/xc/xenctrl.ml  | 1 +
 tools/ocaml/libs/xc/xenctrl.mli | 1 +
 2 files changed, 2 insertions(+)
tools/ocaml/libs/xc/xenctrl.ml +1 -0
index 2690f9a923..7e1aabad6c 100644
@@ -70,6 +70,7 @@ type domain_create_flag =
   | CDF_IOMMU
   | CDF_NESTED_VIRT
   | CDF_VPMU
+  | CDF_TRAP_UNMAPPED_ACCESSES
 
 type domain_create_iommu_opts =
   | IOMMU_NO_SHAREPT
tools/ocaml/libs/xc/xenctrl.mli +1 -0
index febbe1f6ae..f44dba61ae 100644
@@ -63,6 +63,7 @@ type domain_create_flag =
   | CDF_IOMMU
   | CDF_NESTED_VIRT
   | CDF_VPMU
+  | CDF_TRAP_UNMAPPED_ACCESSES
 
 type domain_create_iommu_opts =
   | IOMMU_NO_SHAREPT
Signature · 1 line
2.43.0
Acked-by on v3 4/5
#17 lore raw

Re: [PATCH v3 4/5] tools/ocaml: Update bindings for CDF_TRAP_UNMAPPED_ACCESSES

Quoted 37 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

---
tools/ocaml/libs/xc/xenctrl.ml | 1 +
tools/ocaml/libs/xc/xenctrl.mli | 1 +

2 files changed, 2 insertions(+)
tools/ocaml/libs/xc/xenctrl.ml +1 -0
index 2690f9a923..7e1aabad6c 100644
@@ -70,6 +70,7 @@ type domain_create_flag =
  | CDF_IOMMU
  | CDF_NESTED_VIRT
  | CDF_VPMU
+  | CDF_TRAP_UNMAPPED_ACCESSES
 

type domain_create_iommu_opts =
| IOMMU_NO_SHAREPT

tools/ocaml/libs/xc/xenctrl.mli +1 -0
index febbe1f6ae..f44dba61ae 100644
@@ -63,6 +63,7 @@ type domain_create_flag =
  | CDF_IOMMU
  | CDF_NESTED_VIRT
  | CDF_VPMU
+  | CDF_TRAP_UNMAPPED_ACCESSES
 

type domain_create_iommu_opts =
| IOMMU_NO_SHAREPT

Signature · 1 line
2.43.0
#18 lore raw

PATCH v3 5/5 tools/golang: Regenerate bindings for trap_unmapped_accesses

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

---
 tools/golang/xenlight/helpers.gen.go | 6 ++++++
 tools/golang/xenlight/types.gen.go   | 1 +
 2 files changed, 7 insertions(+)
tools/golang/xenlight/helpers.gen.go +6 -0
index 90846ea8e8..191be87297 100644
@@ -1170,6 +1170,9 @@ x.Altp2M = Altp2MMode(xc.altp2m)
 x.VmtraceBufKb = int(xc.vmtrace_buf_kb)
 if err := x.Vpmu.fromC(&xc.vpmu);err != nil {
 return fmt.Errorf("converting field Vpmu: %v", err)
+}
+if err := x.TrapUnmappedAccesses.fromC(&xc.trap_unmapped_accesses);err != nil {
+return fmt.Errorf("converting field TrapUnmappedAccesses: %v", err)
 }
 
  return nil}
@@ -1695,6 +1698,9 @@ xc.altp2m = C.libxl_altp2m_mode(x.Altp2M)
 xc.vmtrace_buf_kb = C.int(x.VmtraceBufKb)
 if err := x.Vpmu.toC(&xc.vpmu); err != nil {
 return fmt.Errorf("converting field Vpmu: %v", err)
+}
+if err := x.TrapUnmappedAccesses.toC(&xc.trap_unmapped_accesses); err != nil {
+return fmt.Errorf("converting field TrapUnmappedAccesses: %v", err)
 }
 
  return nil
tools/golang/xenlight/types.gen.go +1 -0
index e7667f1ce3..656933c6c9 100644
@@ -606,6 +606,7 @@ MsrRelaxed Defbool
 Altp2M Altp2MMode
 VmtraceBufKb int
 Vpmu Defbool
+TrapUnmappedAccesses Defbool
 }
 
 type DomainBuildInfoTypeUnion interface {
Signature · 1 line
2.43.0