x86: add dom0 memory sizing variants
authorJuergen Gross <jgross@suse.com>
Tue, 11 Dec 2018 08:43:00 +0000 (09:43 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 11 Dec 2018 08:43:00 +0000 (09:43 +0100)
commit76a68b902062a5ca9053f5cf6a3ab46148cb45f2
tree6bb4b4dafd7d81987eaea2f05478dc0c87839f55
parentee507ce9a1e8ef58e75ca3b59bc3db44313c661c
x86: add dom0 memory sizing variants

Today the memory size of dom0 can be specified only in terms of bytes
(either an absolute value or "host-mem - value"). When dom0 shouldn't
be auto-ballooned this requires nearly always a manual adaption of the
Xen boot parameters to reflect the actual host memory size.

Add more possibilities to specify memory sizes. Today we have:

dom0_mem= List of ( min:<size> | max:<size> | <size> )

with <size> being a positive or negative size value (e.g. 1G).

Modify that to:

dom0_mem= List of ( min:<sz> | max:<sz> | <sz> )
<sz>: <size> | [<size>+]<frac>%
<frac>: integer value < 100

With the following semantics:

<frac>% specifies a fraction of host memory size in percent.
<sz> is a percentage of host memory plus an offset.

So <sz> being 1G+25% on a 256G host would result in 65G.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
docs/misc/xen-command-line.markdown
xen/arch/x86/dom0_build.c