Skip to contentSkip to conversation

libxl: Introduce a new guest config file parameter

PATCH Superseded Wei Wang 1 participant 1 message Jan 20, 2012 1 message not in the archive

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Wei Wang

author
#1 lore raw

PATCH v4 1/1 libxl: Introduce a new guest config file parameter

# HG changeset patch
# User Wei Wang <[email protected]>
# Date 1327074009 -3600
# Node ID e71836563bfabed56c0140ad0bcaab517d82c894
# Parent a768bb39d0bc64360055e7fce0e890be71920e63
libxl: Introduce a new guest config file parameter
Use guest_iommu = {1,0} to enable or disable guest iommu emulation. Default value is 0.

docs/man/xl.cfg.pod.5 +0 -0
diff -r a768bb39d0bc -r e71836563bfa docs/man/xl.cfg.pod.5
@@ -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

tools/libxl/libxl_create.c +1 -0
diff -r a768bb39d0bc -r e71836563bfa tools/libxl/libxl_create.c
@@ -93,6 +93,7 @@ int libxl_init_build_info(libxl_ctx *ctx
         b_info->u.hvm.timer_mode = 1;
         b_info->u.hvm.nested_hvm = 0;
         b_info->u.hvm.no_incr_generationid = 0;
+        b_info->u.hvm.guest_iommu = 0;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         b_info->u.pv.slack_memkb = 8 * 1024;
@@ -183,13 +184,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:
tools/libxl/libxl_types.idl +1 -0
diff -r a768bb39d0bc -r e71836563bfa tools/libxl/libxl_types.idl
@@ -185,6 +185,7 @@ libxl_domain_build_info = Struct("domain
                                        ("timer_mode", integer),
                                        ("nested_hvm", bool),
                                        ("no_incr_generationid", bool),
+                                       ("guest_iommu", bool),
                                        ])),
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
                                       ("slack_memkb", uint32),
tools/libxl/xl_cmdimpl.c +2 -0
diff -r a768bb39d0bc -r e71836563bfa tools/libxl/xl_cmdimpl.c
@@ -768,6 +768,8 @@ static void parse_config_data(const char
             b_info->u.hvm.timer_mode = l;
         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:
     {

_______________________________________________
osrc-patches mailing list
[email protected]
https://elbe.amd.com/mailman/listinfo/osrc-patches