@@ -444,6 +444,21 @@ unpausing the domain. With a properly constructed security policy (such
as nomigrate_t in the example policy), this can be used to build a
domain whose memory is not accessible to the toolstack domain.
+=item B<grant_frames=NUMBER>
+
+Specify the maximum number of grant frames the domain is allowed to have.
+This value controls how many pages the domain is able to grant access to for
+other domains, needed e.g. for the operation of paravirtualized devices.
+The default is 32, if not set to another value via a Xen boot parameter.
+
+=item B<maptrack_frames=NUMBER>
+
+Specify the maximum number of grant maptrack frames the domain is allowed
+to have. This value controls how many pages of foreign domains can be accessed
+via the grant mechanism by this domain. A value higher than the normal default
+of 1024 is normally needed only for very large configurations for driver
+domains.
+
=item B<nomigrate=BOOLEAN>
Disable migration of this domain. This enables certain other features
@@ -311,6 +311,12 @@
#define LIBXL_HAVE_P9S 1
/*
+ * LIBXL_HAVE_BUILDINFO_GRANT_LIMITS indicates that libxl_domain_build_info
+ * has the grant_frames and maptrack_frames fields.
+ */
+#define LIBXL_HAVE_BUILDINFO_GRANT_LIMITS 1
+
+/*
* libxl ABI compatibility
*
* The only guarantee which libxl makes regarding ABI compatibility
@@ -322,6 +322,14 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
return ERROR_FAIL;
}
+ if (info->grant_frames || info->maptrack_frames) {
+ if (xc_domain_set_gnttbl_limits(ctx->xch, domid, info->grant_frames,
+ info->maptrack_frames) != 0) {
+ LOG(ERROR, "Couldn't set grant table limits");
+ return ERROR_FAIL;
+ }
+ }
+
/*
* Check if the domain has any CPU or node affinity already. If not, try
* to build up the latter via automatic NUMA placement. In fact, in case
@@ -472,6 +472,9 @@ libxl_domain_build_info = Struct("domain_build_info",[
("blkdev_start", string),
("vnuma_nodes", Array(libxl_vnode_info, "num_vnuma_nodes")),
+
+ ("grant_frames", uint32),
+ ("maptrack_frames", uint32),
("device_model_version", libxl_device_model_version),
("device_model_stubdomain", libxl_defbool),
@@ -943,6 +943,11 @@ void parse_config_data(const char *config_source,
!xlu_cfg_get_string (config, "cpus_soft", &buf, 0))
parse_vcpu_affinity(b_info, cpus, buf, num_cpus, false);
+ if (!xlu_cfg_get_long (config, "grant_frames", &l, 0))
+ b_info->grant_frames = l;
+ if (!xlu_cfg_get_long (config, "maptrack_frames", &l, 0))
+ b_info->maptrack_frames = l;
+
libxl_defbool_set(&b_info->claim_mode, claim_mode);
if (xlu_cfg_get_string (config, "on_poweroff", &buf, 0))
@@ -64,6 +64,8 @@ void printf_info_sexp(int domid, libxl_domain_config *d_config, FILE *fh)
fprintf(fh, "\t(build_info)\n");
fprintf(fh, "\t(max_vcpus %d)\n", b_info->max_vcpus);
+ fprintf(fh, "\t(grant_frames %d)\n", b_info->grant_frames);
+ fprintf(fh, "\t(maptrack_frames %d)\n", b_info->maptrack_frames);
fprintf(fh, "\t(tsc_mode %s)\n", libxl_tsc_mode_to_string(b_info->tsc_mode));
fprintf(fh, "\t(max_memkb %"PRId64")\n", b_info->max_memkb);
fprintf(fh, "\t(target_memkb %"PRId64")\n", b_info->target_memkb);
Add new domain config items for setting the limits for the maximum numbers of grant table frames and maptrack frames of a domain. Signed-off-by: Juergen Gross <jgross@suse.com> --- docs/man/xl.cfg.pod.5.in | 15 +++++++++++++++ tools/libxl/libxl.h | 6 ++++++ tools/libxl/libxl_dom.c | 8 ++++++++ tools/libxl/libxl_types.idl | 3 +++ tools/xl/xl_parse.c | 5 +++++ tools/xl/xl_sxp.c | 2 ++ 6 files changed, 39 insertions(+)