From: Paul Durrant <Paul.Durrant@citrix.com>
To: 'Juergen Gross' <jgross@suse.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: "sstabellini@kernel.org" <sstabellini@kernel.org>,
Wei Liu <wei.liu2@citrix.com>,
Andrew Cooper <Andrew.Cooper3@citrix.com>,
"Tim (Xen.org)" <tim@xen.org>,
George Dunlap <George.Dunlap@citrix.com>,
"julien.grall@arm.com" <julien.grall@arm.com>,
"jbeulich@suse.com" <jbeulich@suse.com>,
Ian Jackson <Ian.Jackson@citrix.com>
Subject: Re: [PATCH v3 8/8] libxl: add libxl support for setting grant table resource limits
Date: Wed, 6 Sep 2017 13:10:48 +0000 [thread overview]
Message-ID: <592b68e3c5c24ad69e4f9393bd026d4b@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <20170906124653.5408-9-jgross@suse.com>
> -----Original Message-----
> From: Xen-devel [mailto:xen-devel-bounces@lists.xen.org] On Behalf Of
> Juergen Gross
> Sent: 06 September 2017 13:47
> To: xen-devel@lists.xen.org
> Cc: Juergen Gross <jgross@suse.com>; sstabellini@kernel.org; Wei Liu
> <wei.liu2@citrix.com>; George Dunlap <George.Dunlap@citrix.com>;
> Andrew Cooper <Andrew.Cooper3@citrix.com>; Ian Jackson
> <Ian.Jackson@citrix.com>; Tim (Xen.org) <tim@xen.org>;
> julien.grall@arm.com; jbeulich@suse.com
> Subject: [Xen-devel] [PATCH v3 8/8] libxl: add libxl support for setting grant
> table resource limits
>
> 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>
Reviewed-by: Paul Durrant <paul.durrant@citrix.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(+)
>
> diff --git a/docs/man/xl.cfg.pod.5.in b/docs/man/xl.cfg.pod.5.in
> index 79cb2eaea7..dd0b232020 100644
> --- a/docs/man/xl.cfg.pod.5.in
> +++ b/docs/man/xl.cfg.pod.5.in
> @@ -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
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 812b7ea95d..fef22c2306 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -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
> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
> index f54fd49a73..080335874e 100644
> --- a/tools/libxl/libxl_dom.c
> +++ b/tools/libxl/libxl_dom.c
> @@ -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_gnttab_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
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 173d70acec..2aa7dae83e 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -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),
> diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
> index 02ddd2e90d..dae3a238a4 100644
> --- a/tools/xl/xl_parse.c
> +++ b/tools/xl/xl_parse.c
> @@ -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))
> diff --git a/tools/xl/xl_sxp.c b/tools/xl/xl_sxp.c
> index e738bf2465..4b2fab2d35 100644
> --- a/tools/xl/xl_sxp.c
> +++ b/tools/xl/xl_sxp.c
> @@ -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);
> --
> 2.12.3
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-09-06 13:10 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-06 12:46 [PATCH v3 0/8] xen: better grant v2 support Juergen Gross
2017-09-06 12:46 ` [PATCH v3 1/8] xen: move XENMAPSPACE_grant_table code into grant_table.c Juergen Gross
2017-09-06 12:46 ` [PATCH v3 2/8] xen: clean up grant_table.h Juergen Gross
2017-09-06 12:46 ` [PATCH v3 3/8] xen: delay allocation of grant table sub structures Juergen Gross
2017-09-06 13:04 ` Paul Durrant
2017-09-06 15:11 ` Wei Liu
2017-09-06 15:15 ` Juergen Gross
2017-09-06 15:32 ` Wei Liu
2017-09-06 15:36 ` Juergen Gross
2017-09-06 15:42 ` Wei Liu
2017-09-06 12:46 ` [PATCH v3 4/8] xen: make grant resource limits per domain Juergen Gross
2017-09-06 15:58 ` Wei Liu
2017-09-06 12:46 ` [PATCH v3 5/8] xen: double default grant frame limit for huge hosts Juergen Gross
2017-09-06 16:03 ` Wei Liu
2017-09-06 12:46 ` [PATCH v3 6/8] xen: add new domctl hypercall to set grant table resource limits Juergen Gross
2017-09-06 13:07 ` Paul Durrant
2017-09-07 8:54 ` Wei Liu
2017-09-06 12:46 ` [PATCH v3 7/8] libxc: add libxc support for setting " Juergen Gross
2017-09-06 13:08 ` Paul Durrant
2017-09-07 8:55 ` Wei Liu
2017-09-07 9:06 ` Juergen Gross
2017-09-06 12:46 ` [PATCH v3 8/8] libxl: add libxl " Juergen Gross
2017-09-06 13:10 ` Paul Durrant [this message]
2017-09-07 9:02 ` Wei Liu
2017-09-07 9:06 ` Juergen Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=592b68e3c5c24ad69e4f9393bd026d4b@AMSPEX02CL03.citrite.net \
--to=paul.durrant@citrix.com \
--cc=Andrew.Cooper3@citrix.com \
--cc=George.Dunlap@citrix.com \
--cc=Ian.Jackson@citrix.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=julien.grall@arm.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).