From: Ian Campbell <Ian.Campbell@citrix.com>
To: Don Slutz <dslutz@verizon.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
xen-devel@lists.xen.org, Jan Beulich <jbeulich@suse.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH for 4.5 v7 1/1] Add mmio_hole_size
Date: Mon, 20 Oct 2014 15:17:57 +0100 [thread overview]
Message-ID: <1413814677.13796.10.camel@citrix.com> (raw)
In-Reply-To: <1413204679-7345-2-git-send-email-dslutz@verizon.com>
On Mon, 2014-10-13 at 08:51 -0400, Don Slutz wrote:
> diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
> index 8bba21c..10e995a 100644
> --- a/docs/man/xl.cfg.pod.5
> +++ b/docs/man/xl.cfg.pod.5
> @@ -1111,6 +1111,21 @@ wallclock (i.e., real) time.
>
> =back
>
> +=head3 Memory layout
> +
> +=over 4
> +
> +=item B<mmio_hole_size=BYTES>
> +
> +Specifies the size the MMIO hole below 4GiB will be. Only valid for
> +device_model_version = "qemu-xen".
> +
> +Cannot be smaller than 256MiB. Cannot be larger than 3840MiB.
> +
> +Known good large value is 3GiB (3221225472).
I think the literal values "3GiB"/"3840MiB" etc won't work, will they?
Is there any need to be able to specify this size at byte granularity?
All of the other xl options use MBYTES as there units, which is much
easier for people to deal with (e.g. 3072 vs 3221225272).
> @@ -696,10 +698,28 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
> /* Switching here to the machine "pc" which does not add
> * the xen-platform device instead of the default "xenfv" machine.
> */
> - flexarray_append(dm_args, "pc,accel=xen");
> + machinearg = libxl__sprintf(gc, "pc,accel=xen");
> } else {
> - flexarray_append(dm_args, "xenfv");
> + machinearg = libxl__sprintf(gc, "xenfv");
> }
> + if (b_info->u.hvm.mmio_hole_size) {
> + uint64_t max_ram_below_4g = (1ULL << 32) -
> + b_info->u.hvm.mmio_hole_size;
> +
> + if (max_ram_below_4g > HVM_BELOW_4G_MMIO_START) {
> + LIBXL__LOG(ctx, LIBXL__LOG_WARNING,
> + "max-ram-below-4g=%"PRIu64
> + " (mmio_hole_size=%"PRIu64
> + ") too big > %u ignored.\n",
Using the LOG macro would indent this code less and allow you to wrap in
a more sensible/readable way. Do you really need to print both
max-ram-below-4g and mmio_hole_size given that one is derived trivially
from the other.
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index bbb03e2..2a71e9a 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -391,6 +391,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
> ("timeoffset", string),
> ("hpet", libxl_defbool),
> ("vpt_align", libxl_defbool),
> + ("mmio_hole_size", uint64),
Please make this a MemKB at the libxl interface level and convert
internally to whatever hvmloader expects. It seems that a more
conventional name would also have a _memkb suffix. Perhaps
mmio_hole_memkb? (size seems to be implicit to me).
> +#include <xen/hvm/e820.h>
>
> #include "libxl.h"
> #include "libxl_utils.h"
> @@ -1111,6 +1112,21 @@ static void parse_config_data(const char *config_source,
> exit(-ERROR_FAIL);
> }
>
> + if (!xlu_cfg_get_long(config, "mmio_hole_size", &l, 0)) {
> + b_info->u.hvm.mmio_hole_size = (uint64_t) l;
This cast isn't needed, is it?
> + /*
> + * With HVM_BELOW_4G_RAM_END == 0xF0000000, mmio_hole_size
> + * must be >= 256 MiB and <= 3840 MiB.
Isn't this just restating the if condition in a way which is liable to
get out of sync if the values of HVM_BELOW_4G_* ever changes?
> + */
> + if (b_info->u.hvm.mmio_hole_size < HVM_BELOW_4G_MMIO_LENGTH ||
> + b_info->u.hvm.mmio_hole_size > HVM_BELOW_4G_MMIO_START) {
> + fprintf(stderr, "ERROR: invalid value 0x%"PRIx64" (%"PRIu64
> + ") for \"mmio_hole_size\"\n",
> + b_info->u.hvm.mmio_hole_size,
> + b_info->u.hvm.mmio_hole_size);
Can we not trust people to be able to convert to/from hex if they need
to?
Ian.
next prev parent reply other threads:[~2014-10-20 14:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-13 12:51 [PATCH for 4.5 v7 0/1] Add mmio_hole_size (was Add pci_hole_min_size) Don Slutz
2014-10-13 12:51 ` [PATCH for 4.5 v7 1/1] Add mmio_hole_size Don Slutz
2014-10-14 15:56 ` Konrad Rzeszutek Wilk
2014-10-15 16:12 ` Wei Liu
2014-10-21 12:56 ` Don Slutz
2014-10-20 14:10 ` George Dunlap
2014-10-20 14:17 ` Ian Campbell [this message]
2014-10-20 22:01 ` Don Slutz
2014-10-21 7:46 ` Jan Beulich
2014-10-21 7:57 ` Ian Campbell
2014-10-21 12:58 ` Don Slutz
2014-10-21 14:26 ` Konrad Rzeszutek Wilk
2014-10-21 7:52 ` Ian Campbell
2014-10-23 16:57 ` Steve Freitas
2014-10-23 20:39 ` Andrew Cooper
2014-10-23 20:47 ` Steve Freitas
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=1413814677.13796.10.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=dslutz@verizon.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=stefano.stabellini@eu.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 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.