|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 6 of 6 V5] libxl: Introduce a new guest config file parameter
# HG changeset patch
# User Wei Wang <wei.wang2@xxxxxxx>
# Date 1328885360 -3600
# Node ID 09721a5ff84451b5a95d6cdc445867fa158dd449
# Parent c39f5736e36429091839a8db10179deeb6b0c622
libxl: Introduce a new guest config file parameter
Use guest_iommu = {1,0} to enable or disable guest iommu emulation.
Default value is 0. Regression tests have been done to make sure
it does not break non-iommuv2 systems.
Signed-off-by: Wei Wang <wei.wang2@xxxxxxx>
diff -r c39f5736e364 -r 09721a5ff844 docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5 Fri Feb 10 15:49:19 2012 +0100
+++ b/docs/man/xl.cfg.pod.5 Fri Feb 10 15:49:20 2012 +0100
@@ -820,6 +820,10 @@ certainly belong in a more appropriate s
Enable graphics device PCI passthrough. XXX which device is passed through ?
+=item B<guest_iommu=BOOLEAN>
+
+Enable virtual iommu device for hvm guest. It should be enabled to passthrough
AMD GPGPU.
+
=item B<nomigrate=BOOLEAN>
Disable migration of this domain. This enables certain other features
diff -r c39f5736e364 -r 09721a5ff844 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c Fri Feb 10 15:49:19 2012 +0100
+++ b/tools/libxl/libxl_create.c Fri Feb 10 15:49:20 2012 +0100
@@ -100,6 +100,7 @@ int libxl_init_build_info(libxl_ctx *ctx
b_info->u.hvm.vpt_align = 1;
b_info->u.hvm.timer_mode = 1;
b_info->u.hvm.nested_hvm = 0;
+ b_info->u.hvm.guest_iommu = 0;
b_info->u.hvm.no_incr_generationid = 0;
b_info->u.hvm.stdvga = 0;
@@ -169,13 +170,15 @@ int libxl__domain_build(libxl__gc *gc,
vments[4] = "start_time";
vments[5] = libxl__sprintf(gc, "%lu.%02d",
start_time.tv_sec,(int)start_time.tv_usec/10000);
- localents = libxl__calloc(gc, 7, sizeof(char *));
+ localents = libxl__calloc(gc, 9, sizeof(char *));
localents[0] = "platform/acpi";
localents[1] = (info->u.hvm.acpi) ? "1" : "0";
localents[2] = "platform/acpi_s3";
localents[3] = (info->u.hvm.acpi_s3) ? "1" : "0";
localents[4] = "platform/acpi_s4";
localents[5] = (info->u.hvm.acpi_s4) ? "1" : "0";
+ localents[6] = "guest_iommu";
+ localents[7] = (info->u.hvm.guest_iommu) ? "1" : "0";
break;
case LIBXL_DOMAIN_TYPE_PV:
diff -r c39f5736e364 -r 09721a5ff844 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl Fri Feb 10 15:49:19 2012 +0100
+++ b/tools/libxl/libxl_types.idl Fri Feb 10 15:49:20 2012 +0100
@@ -239,6 +239,7 @@ libxl_domain_build_info = Struct("domain
("vpt_align", bool),
("timer_mode", libxl_timer_mode),
("nested_hvm", bool),
+ ("guest_iommu", bool),
("no_incr_generationid", bool),
("nographic", bool),
("stdvga", bool),
diff -r c39f5736e364 -r 09721a5ff844 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Fri Feb 10 15:49:19 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c Fri Feb 10 15:49:20 2012 +0100
@@ -748,6 +748,8 @@ static void parse_config_data(const char
if (!xlu_cfg_get_long (config, "nestedhvm", &l, 0))
b_info->u.hvm.nested_hvm = l;
+ if (!xlu_cfg_get_long (config, "guest_iommu", &l, 0))
+ b_info->u.hvm.guest_iommu = l;
break;
case LIBXL_DOMAIN_TYPE_PV:
{
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |