From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
George Dunlap <george.dunlap@citrix.com>,
Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Subject: [PATCH] xen/grants: repurpose command line max options
Date: Mon, 13 Mar 2023 13:16:32 +0100 [thread overview]
Message-ID: <20230313121632.86789-1-roger.pau@citrix.com> (raw)
Slightly change the meaning of the command line
gnttab_max_{maptrack_,}frames: do not use them as upper bounds for the
passed values at domain creation, instead just use them as defaults
in the absence of any provided value.
It's not very useful for the options to be used both as defaults and
as capping values for domain creation inputs. The defaults passed on
the command line are used by dom0 which has a very different grant
requirements than a regular domU. dom0 usually needs a bigger
maptrack array, while domU usually require a bigger number of grant
frames.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
docs/misc/xen-command-line.pandoc | 12 ++++++------
xen/common/grant_table.c | 9 +++------
2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index f68deaa6a9..f09d1b23da 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1232,9 +1232,8 @@ The usage of gnttab v2 is not security supported on ARM platforms.
> Can be modified at runtime
-Specify the maximum number of frames which any domain may use as part
-of its grant table. This value is an upper boundary of the per-domain
-value settable via Xen tools.
+Specify the default maximum number of frames which any domain may use as part
+of its grant table unless a different value is specified at domain creation.
Dom0 is using this value for sizing its grant table.
@@ -1245,9 +1244,10 @@ Dom0 is using this value for sizing its grant table.
> Can be modified at runtime
-Specify the maximum number of frames to use as part of a domains
-maptrack array. This value is an upper boundary of the per-domain
-value settable via Xen tools.
+Specify the default maximum number of frames to use as part of a domains
+maptrack array unless a different value is specified at domain creation.
+
+Dom0 is using this value for sizing its maptrack array.
### global-pages
= <boolean>
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index b896f9af0e..627bf4026c 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1956,18 +1956,15 @@ int grant_table_init(struct domain *d, int max_grant_frames,
return -EINVAL;
}
- /* Default to maximum value if no value was specified */
+ /* Apply defaults if no value was specified */
if ( max_grant_frames < 0 )
max_grant_frames = opt_max_grant_frames;
if ( max_maptrack_frames < 0 )
max_maptrack_frames = opt_max_maptrack_frames;
- if ( max_grant_frames < INITIAL_NR_GRANT_FRAMES ||
- max_grant_frames > opt_max_grant_frames ||
- max_maptrack_frames > opt_max_maptrack_frames )
+ if ( max_grant_frames < INITIAL_NR_GRANT_FRAMES )
{
- dprintk(XENLOG_INFO, "Bad grant table sizes: grant %u, maptrack %u\n",
- max_grant_frames, max_maptrack_frames);
+ dprintk(XENLOG_INFO, "Bad grant table size %u\n", max_grant_frames);
return -EINVAL;
}
--
2.39.0
next reply other threads:[~2023-03-13 13:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 12:16 Roger Pau Monne [this message]
2023-03-13 16:55 ` [PATCH] xen/grants: repurpose command line max options Jan Beulich
2023-03-14 9:22 ` Roger Pau Monné
2023-03-14 10:04 ` Jan Beulich
2023-03-14 10:25 ` Roger Pau Monné
2023-03-14 10:31 ` Jan Beulich
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=20230313121632.86789-1-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.