All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Wei.Liu2@citrix.com, ian.campbell@citrix.com,
	Tim Deegan <tim@xen.org>, Ian Jackson <ian.jackson@eu.citrix.com>,
	stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org,
	Keir Fraser <keir@xen.org>
Subject: Re: [PATCH for-4.6] xen/mm: populate_physmap: validate correctly the gfn for direct mapped domain
Date: Wed, 12 Aug 2015 10:25:32 +0100	[thread overview]
Message-ID: <55CB110C.1090502@citrix.com> (raw)
In-Reply-To: <55CB2B0B020000780009A035@prv-mh.provo.novell.com>

Hi Jan,

On 12/08/2015 10:16, Jan Beulich wrote:
>>>> On 11.08.15 at 19:41, <julien.grall@citrix.com> wrote:
>> --- a/xen/common/memory.c
>> +++ b/xen/common/memory.c
>> @@ -126,22 +126,28 @@ static void populate_physmap(struct memop_args *a)
>>               if ( is_domain_direct_mapped(d) )
>>               {
>>                   mfn = gpfn;
>> -                if ( !mfn_valid(mfn) )
>> +
>> +                for ( j = 0; j < (1 << a->extent_order); j++, mfn++ )
>
> While benign I think we shouldn't repeat mistakes like this made
> elsewhere in the code: At the very least this should be 1U, but
> with j (needlessly, just like i) being unsigned long it would be
> more consistent for this to be 1UL unless we clean up the variable
> types (which I think I'll do).

I admit that I copied the loop at then end of the function without 
thinking if it there was some issue or not.

>
> Since the change is so minor, I'd be fine with making it while
> committing, unless you object.

I'm fine with that.

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-08-12  9:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11 17:41 [PATCH for-4.6] xen/mm: populate_physmap: validate correctly the gfn for direct mapped domain Julien Grall
2015-08-12  9:16 ` Jan Beulich
2015-08-12  9:25   ` Julien Grall [this message]
2015-08-12  9:19 ` Wei Liu
2015-08-12  9:28   ` Wei Liu
2015-08-13  9:33 ` Ian Campbell
2015-08-13  9:54   ` Jan Beulich
2015-08-13 10:14     ` Ian Campbell
2015-08-13 10:29       ` Jan Beulich
2015-08-13 10:41         ` Ian Campbell

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=55CB110C.1090502@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Wei.Liu2@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@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.