From 3115091dde4184ef8ca4c23739bf4455b54cf3b4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 22 Dec 2017 16:12:23 +0000 Subject: [PATCH] xl: pvshim: Provide and document xl config Signed-off-by: Ian Jackson Signed-off-by: Wei Liu --- docs/man/xl.cfg.pod.5.in | 35 +++++++++++++++++++++++++++++++++++ tools/xl/xl_parse.c | 14 ++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/docs/man/xl.cfg.pod.5.in b/docs/man/xl.cfg.pod.5.in index b7b91d8627..bf6c266de1 100644 --- a/docs/man/xl.cfg.pod.5.in +++ b/docs/man/xl.cfg.pod.5.in @@ -508,6 +508,41 @@ Load the specified file as firmware for the guest. Currently there's no firmware available for PVH guests, they should be booted using the B method or the B option. +=over 4 + +=item B + +Whether to boot this guest as a PV guest within a PVH container. +Ie, the guest will experience a PV environment, +but +processor hardware extensions are used to +separate its address space +to mitigate the Meltdown attack (CVE-2017-5754). + +Default is false. + +=item B + +The PV shim is a specially-built firmware-like executable +constructed from the hypervisor source tree. +This option specifies to use a non-default shim. +Ignored if pvhsim is false. + +=item B + +Command line for the shim. +Default is "pv-shim console=xen,pv sched=null". +Ignored if pvhsim is false. + +=item B + +Extra command line arguments for the shim. +If supplied, appended to the value for pvshim_cmdline. +Default is empty. +Ignored if pvhsim is false. + +=back + =head3 Other Options =over 4 diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 9a692d5ae6..fdfe693de1 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -964,6 +964,20 @@ void parse_config_data(const char *config_source, xlu_cfg_replace_string(config, "pool", &c_info->pool_name, 0); libxl_domain_build_info_init_type(b_info, c_info->type); + + if (b_info->type == LIBXL_DOMAIN_TYPE_PVH) { + xlu_cfg_get_defbool(config, "pvshim", &b_info->u.pvh.pvshim, 0); + if (!xlu_cfg_get_string(config, "pvshim_path", &buf, 0)) + xlu_cfg_replace_string(config, "pvshim_path", + &b_info->u.pvh.pvshim_path, 0); + if (!xlu_cfg_get_string(config, "pvshim_cmdline", &buf, 0)) + xlu_cfg_replace_string(config, "pvshim_cmdline", + &b_info->u.pvh.pvshim_cmdline, 0); + if (!xlu_cfg_get_string(config, "pvshim_extra", &buf, 0)) + xlu_cfg_replace_string(config, "pvshim_extra", + &b_info->u.pvh.pvshim_extra, 0); + } + if (blkdev_start) b_info->blkdev_start = strdup(blkdev_start); -- 2.30.2