@@ -400,6 +400,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
b_info->cmdline = b_info->u.pv.cmdline;
b_info->u.pv.cmdline = NULL;
}
+ libxl_defbool_setdefault(&b_info->u.pv.altp2m, false);
break;
default:
LOG(ERROR, "invalid domain type %s in create info",
@@ -277,6 +277,16 @@ err:
}
#endif
+#if defined(__arm__) || defined(__aarch64__)
+static void pv_set_conf_params(xc_interface *handle, uint32_t domid,
+ libxl_domain_build_info *const info)
+{
+ if ( libxl_defbool_val(info->u.pv.altp2m) )
+ xc_hvm_param_set(handle, domid, HVM_PARAM_ALTP2M,
+ libxl_defbool_val(info->u.pv.altp2m));
+}
+#endif
+
static void hvm_set_conf_params(xc_interface *handle, uint32_t domid,
libxl_domain_build_info *const info)
{
@@ -433,6 +443,10 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
return rc;
#endif
}
+#if defined(__arm__) || defined(__aarch64__)
+ else /* info->type == LIBXL_DOMAIN_TYPE_PV */
+ pv_set_conf_params(ctx->xch, domid, info);
+#endif
rc = libxl__arch_domain_create(gc, d_config, domid);
@@ -554,6 +554,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
("features", string, {'const': True}),
# Use host's E820 for PCI passthrough.
("e820_host", libxl_defbool),
+ ("altp2m", libxl_defbool),
])),
("invalid", None),
], keyvar_init_val = "LIBXL_DOMAIN_TYPE_INVALID")),
@@ -1718,6 +1718,11 @@ static void parse_config_data(const char *config_source,
exit(1);
}
+#if defined(__arm__) || defined(__aarch64__)
+ /* Enable altp2m for PV guests solely on ARM */
+ xlu_cfg_get_defbool(config, "altp2m", &b_info->u.pv.altp2m, 0);
+#endif
+
break;
}
default:
The current implementation allows to set the parameter HVM_PARAM_ALTP2M. This parameter allows further usage of altp2m on ARM. For this, we define an additional altp2m field for PV domains as part of the libxl_domain_type struct. This field can be set only on ARM systems through the "altp2m" switch in the domain's configuration file (i.e. set altp2m=1). Signed-off-by: Sergej Proskurin <proskurin@sec.in.tum.de> --- Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> --- tools/libxl/libxl_create.c | 1 + tools/libxl/libxl_dom.c | 14 ++++++++++++++ tools/libxl/libxl_types.idl | 1 + tools/libxl/xl_cmdimpl.c | 5 +++++ 4 files changed, 21 insertions(+)