@@ -453,7 +453,7 @@ int libxl__domain_build(libxl__gc *gc,
vments[4] = "start_time";
vments[5] = GCSPRINTF("%lu.%02d", start_time.tv_sec,(int)start_time.tv_usec/10000);
- localents = libxl__calloc(gc, 9, sizeof(char *));
+ localents = libxl__calloc(gc, 11, sizeof(char *));
i = 0;
localents[i++] = "platform/acpi";
localents[i++] = libxl__acpi_defbool_val(info) ? "1" : "0";
@@ -472,6 +472,11 @@ int libxl__domain_build(libxl__gc *gc,
info->u.hvm.mmio_hole_memkb << 10);
}
}
+ if (info->u.hvm.viommu.base_addr) {
+ localents[i++] = "viommu/base_addr";
+ localents[i++] =
+ GCSPRINTF("%"PRIu64, info->u.hvm.viommu.base_addr);
+ }
break;
case LIBXL_DOMAIN_TYPE_PV:
@@ -680,6 +685,11 @@ retry_transaction:
GCSPRINTF("%s/attr", dom_path),
rwperm, ARRAY_SIZE(rwperm));
+ if (info->type == LIBXL_DOMAIN_TYPE_HVM)
+ libxl__xs_mknod(gc, t,
+ GCSPRINTF("%s/viommu", dom_path),
+ noperm, ARRAY_SIZE(noperm));
+
if (libxl_defbool_val(info->driver_domain)) {
/*
* Create a local "libxl" directory for each guest, since we might want
@@ -1252,6 +1252,15 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
flexarray_append(dm_args, "-net");
flexarray_append(dm_args, "none");
}
+
+ if ( !libxl_defbool_is_default(b_info->u.hvm.viommu.intremap)
+ && libxl_defbool_val(b_info->u.hvm.viommu.intremap) )
+ {
+ flexarray_append(dm_args, "-device");
+ flexarray_append(dm_args,
+ GCSPRINTF("xen_viommu,cap=%ld",
+ b_info->u.hvm.viommu.cap));
+ }
} else {
if (!sdl && !vnc) {
flexarray_append(dm_args, "-nographic");