From: Julien Grall <julien.grall@linaro.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>,
ian.campbell@citrix.com, patches@linaro.org, tim@xen.org,
stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] xen/arm: Allow balooning working with 1:1 memory mapping
Date: Mon, 16 Dec 2013 14:30:53 +0000 [thread overview]
Message-ID: <52AF0E9D.5020405@linaro.org> (raw)
In-Reply-To: <52AED12C020000780010D832@nat28.tlf.novell.com>
On 12/16/2013 09:08 AM, Jan Beulich wrote:
>>>> On 13.12.13 at 21:18, Julien Grall <julien.grall@linaro.org> wrote:
>> --- a/xen/common/memory.c
>> +++ b/xen/common/memory.c
>> @@ -90,7 +90,7 @@ static void increase_reservation(struct memop_args *a)
>>
>> static void populate_physmap(struct memop_args *a)
>> {
>> - struct page_info *page;
>> + struct page_info *page = NULL;
>
> Why?
Spurious line from a previous version. I will remove it.
>
>> @@ -122,7 +122,29 @@ static void populate_physmap(struct memop_args *a)
>> }
>> else
>> {
>> - page = alloc_domheap_pages(d, a->extent_order, a->memflags);
>> + if ( d == dom0 && is_dom0_mapped_11() )
>> + {
>> + mfn = gpfn;
>> + if (!mfn_valid(mfn))
>
> Coding style.
>
>> + {
>> + gdprintk(XENLOG_INFO, "Invalid mfn 0x%"PRI_xen_pfn"\n",
>> + mfn);
>> + goto out;
>> + }
>> +
>> + page = mfn_to_page(mfn);
>> + if ( !get_page(page, d) )
>> + {
>> + gdprintk(XENLOG_INFO,
>> + "mfn 0x%"PRI_xen_pfn" doesn't belong to dom0\n",
>> + mfn);
>> + goto out;
>> + }
>> + put_page(page);
>> + }
>
> I think this hack doesn't belong into a common file. Rather than
> having the (anyway oddly named) is_dom0_mapped_11(), it
> would seem more clean to have this implemented by an inline
> function for ARM, returning the struct page_info * (and getting
> #define-d to NULL for all other cases, perhaps not even in an
> x86 header, but right in the source file).
>
> And even if we were to stay with the implementation here, for
> being at least half way sane the checking macro should take a
> domain argument rather than requiring the extra "d == dom0"
> check up front. Plus the "11" there is bogus - I first read this as
> "eleven" rather than "1:1", wondering what eleven here was
> about. I'd suggest something like is_domain_direct_mapped() or
> is_domain_identity_mapped().
>
> Jan
>
--
Julien Grall
prev parent reply other threads:[~2013-12-16 14:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-13 20:18 [PATCH v2] xen/arm: Allow balooning working with 1:1 memory mapping Julien Grall
2013-12-16 9:08 ` Jan Beulich
2013-12-16 12:11 ` Stefano Stabellini
2013-12-16 14:52 ` Julien Grall
2013-12-16 14:30 ` Julien Grall [this message]
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=52AF0E9D.5020405@linaro.org \
--to=julien.grall@linaro.org \
--cc=JBeulich@suse.com \
--cc=ian.campbell@citrix.com \
--cc=keir@xen.org \
--cc=patches@linaro.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.