[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH RESEND v9 12/14] tools/libxl: read from config if passing through primary GPU
This commit adds a new option available for any domU libxl configuration that allows the user to specify if one of the VGA adapters passed through to the domain is the primary one. This way, libxl can arrange the correct I/O-memory access permission for its stubdomain. Signed-off-by: Arianna Avanzini <avanzini.arianna@xxxxxxxxx> Cc: Dario Faggioli <dario.faggioli@xxxxxxxxxx> Cc: Paolo Valente <paolo.valente@xxxxxxxxxx> Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx> Cc: Julien Grall <julien.grall@xxxxxxxxxx> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> Cc: Jan Beulich <JBeulich@xxxxxxxx> Cc: Keir Fraser <keir@xxxxxxx> Cc: Tim Deegan <tim@xxxxxxx> Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Cc: Eric Trudeau <etrudeau@xxxxxxxxxxxx> Cc: Viktor Kleinik <viktor.kleinik@xxxxxxxxxxxxxxx> --- docs/man/xl.cfg.pod.5 | 7 +++++++ tools/libxl/libxl.h | 7 +++++++ tools/libxl/libxl_create.c | 1 + tools/libxl/libxl_types.idl | 3 ++- tools/libxl/xl_cmdimpl.c | 2 ++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 index 5bad491..37790ad 100644 --- a/docs/man/xl.cfg.pod.5 +++ b/docs/man/xl.cfg.pod.5 @@ -601,6 +601,13 @@ More information about Xen gfx_passthru feature is available on the XenVGAPassthrough L<http://wiki.xen.org/wiki/XenVGAPassthrough> wiki page. +=item B<gfx_passthru_primary=BOOLEAN> + +If set to true, indicates that one of the GPUs passed through to the +domain is the primary one; therefore allows to the domain's stubdoman +access permissions for the VGA framebuffer. Note that this option +defaults to true. + =item B<ioports=[ "IOPORT_RANGE", "IOPORT_RANGE", ... ]> Allow guest to access specific legacy I/O ports. Each B<IOPORT_RANGE> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index b1a20da..2341ac0 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -84,6 +84,13 @@ #define LIBXL_HAVE_FIRMWARE_PASSTHROUGH 1 /* + * LIBXL_HAVE_GFX_PASSTHROUGH_PRIMARY indicates that the user must + * specify in the domain configuration whether one of the passthru + * VGA devices is the primary one. + */ +#define LIBXL_HAVE_GFX_PASSTHROUGH_PRIMARY 1 + +/* * LIBXL_HAVE_DOMAIN_NODEAFFINITY indicates that a 'nodemap' field * (of libxl_bitmap type) is present in libxl_domain_build_info, * containing the node-affinity for the domain. diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 1217310..53cad9b 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -337,6 +337,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, libxl_defbool_setdefault(&b_info->u.hvm.nographic, false); libxl_defbool_setdefault(&b_info->u.hvm.gfx_passthru, false); + libxl_defbool_setdefault(&b_info->u.hvm.gfx_passthru_primary, true); break; case LIBXL_DOMAIN_TYPE_PV: diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index 75b5dd0..db9ea76 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -383,7 +383,8 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("sdl", libxl_sdl_info), ("spice", libxl_spice_info), - ("gfx_passthru", libxl_defbool), + ("gfx_passthru", libxl_defbool), + ("gfx_passthru_primary", libxl_defbool), ("serial", string), ("boot", string), diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index b3b7df1..6773f4a 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1646,6 +1646,8 @@ skip_vfb: xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0); xlu_cfg_get_defbool(config, "gfx_passthru", &b_info->u.hvm.gfx_passthru, 0); + xlu_cfg_get_defbool(config, "gfx_passthru_primary", + &b_info->u.hvm.gfx_passthru_primary, 0); xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0); xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0); xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0); -- 1.9.3 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |