From f9b9022b7299fa0ce554a29daa59235e57d10f80 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 15 Jan 2018 12:22:28 +0000 Subject: [PATCH] xl: pvshim: Provide and document xl config Signed-off-by: Ian Jackson Signed-off-by: Wei Liu --- v2: pvshim, not pvhshim works with type "pvh", not type "pv" pvshim_etc. options in config are not erroneously ignored --- docs/man/xl.cfg.pod.5.in | 35 +++++++++++++++++++++++++++++++++++ tools/libxl/xl_cmdimpl.c | 13 +++++++++++++ 2 files changed, 48 insertions(+) diff --git a/docs/man/xl.cfg.pod.5.in b/docs/man/xl.cfg.pod.5.in index d8b5fc74d5..a27ab09237 100644 --- a/docs/man/xl.cfg.pod.5.in +++ b/docs/man/xl.cfg.pod.5.in @@ -506,6 +506,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/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 1bca1286d0..9bd09fac59 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1433,6 +1433,19 @@ static void parse_config_data(const char *config_source, if (blkdev_start) b_info->blkdev_start = strdup(blkdev_start); + 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); + } + /* the following is the actual config parsing with overriding * values in the structures */ if (!xlu_cfg_get_long (config, "cpu_weight", &l, 0)) -- 2.39.5