All of lore.kernel.org
 help / color / mirror / Atom feed
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: Tue, 21 Oct 2014 08:52:33 +0100	[thread overview]
Message-ID: <1413877953.20604.19.camel@citrix.com> (raw)
In-Reply-To: <54458621.3080102@terremark.com>

On Mon, 2014-10-20 at 18:01 -0400, Don Slutz wrote:


> > @@ -1111,6 +1112,17 @@ 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;
> > +            if (b_info->u.hvm.mmio_hole_size < HVM_BELOW_4G_MMIO_LENGTH ||
> 
> Oh boy, this check for 256MB is surely obfuscated by the macros.
> 
> Could you include a comment saying that HVM_BELOW_4G_MMIO_LENGTH resolves
> to 256MB please?
> 
> > +                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",
> 
> ...
> 
> 
> So I do not know which way to go here.

I'm not sure why the fact that HVM_BELOW_4G_MMIO_LENGTH happens to be
256M right now should be of interest to the casual reader of this code.
They can always lookup the #define.

Putting the value of a define next to every use of it somewhat defeats
the purpose of having a define.

Ian.

  parent reply	other threads:[~2014-10-21  7:52 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
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 [this message]
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=1413877953.20604.19.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.