From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
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:52:49 +0000 [thread overview]
Message-ID: <52AF13C1.9020506@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1312161208450.8667@kaball.uk.xensource.com>
On 12/16/2013 12:11 PM, Stefano Stabellini wrote:
> On Mon, 16 Dec 2013, 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?
>>
>>> @@ -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).
>
> Considering that having a 1:1 mapping for dom0 is conceivable even on
> x86 (if you want PVH dom0 but your platform doesn't come with an IOMMU),
> I would prefer the approach taken here. However I find your alternative
> suggestion acceptable too.
I will stay on your solution, with is_dom0_mapped_11 modify to
is_domain_direct_mapped().
--
Julien Grall
next prev parent reply other threads:[~2013-12-16 14:52 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 [this message]
2013-12-16 14:30 ` Julien Grall
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=52AF13C1.9020506@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=stefano.stabellini@eu.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.