From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arianna Avanzini Subject: [PATCH v9 12/14] tools/libxl: read from config if passing through primary GPU Date: Wed, 2 Jul 2014 20:42:21 +0200 Message-ID: <1404326543-16875-13-git-send-email-avanzini.arianna@gmail.com> References: <1404326543-16875-1-git-send-email-avanzini.arianna@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1404326543-16875-1-git-send-email-avanzini.arianna@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Ian.Campbell@eu.citrix.com, paolo.valente@unimore.it, keir@xen.org, stefano.stabellini@eu.citrix.com, Ian.Jackson@eu.citrix.com, dario.faggioli@citrix.com, tim@xen.org, julien.grall@citrix.com, etrudeau@broadcom.com, andrew.cooper3@citrix.com, JBeulich@suse.com, avanzini.arianna@gmail.com, viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org 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 Cc: Dario Faggioli Cc: Paolo Valente Cc: Ian Campbell Cc: Julien Grall Cc: Stefano Stabellini Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan Cc: Ian Jackson Cc: Andrew Cooper Cc: Eric Trudeau Cc: Viktor Kleinik --- 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 025df27..07f9723 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 wiki page. +=item B + +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 Allow guest to access specific legacy I/O ports. Each B diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index ce0d2c2..c59b3c7 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 b5506b1..a44c42a 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -349,6 +349,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 e37e579..754e89d 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -367,7 +367,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 513b404..98b5a6e 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1645,6 +1645,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