From: Penny Zheng <Penny.Zheng@arm.com>
To: <xen-devel@lists.xenproject.org>
Cc: <wei.chen@arm.com>, <henry.wang@arm.com>,
Penny Zheng <Penny.Zheng@arm.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
"George Dunlap" <george.dunlap@citrix.com>,
Jan Beulich <jbeulich@suse.com>, "Julien Grall" <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
Penny Zheng <penny.zheng@arm.com>
Subject: [PATCH v1 4/5] xen/arm: retrieve reserved pages on populate_physmap
Date: Wed, 30 Mar 2022 17:36:16 +0800 [thread overview]
Message-ID: <20220330093617.3870589-5-Penny.Zheng@arm.com> (raw)
In-Reply-To: <20220330093617.3870589-1-Penny.Zheng@arm.com>
When domain on static allocation populates memory through populate_physmap,
other than allocating from heap, it shall allocate from resv_page_list to
make sure that all guest RAM are still restricted in statically configured
regions.
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
---
xen/common/memory.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 2afc3c6f10..2122ceeba7 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -249,6 +249,26 @@ static void populate_physmap(struct memop_args *a)
mfn = _mfn(gpfn);
}
+#ifdef CONFIG_STATIC_MEMORY
+ else if ( is_domain_on_static_allocation(d) )
+ {
+ for ( j = 0; j < (1U << a->extent_order); j++ )
+ {
+ page = page_list_remove_head(&d->resv_page_list);
+ if ( unlikely(!page) )
+ {
+ gdprintk(XENLOG_INFO,
+ "Could not allocate guest page number %lx\n",
+ gfn_x(_gfn(gpfn)));
+ goto out;
+ }
+ d->resv_pages--;
+
+ if ( j == 0 )
+ mfn = page_to_mfn(page);
+ }
+ }
+#endif
else
{
page = alloc_domheap_pages(d, a->extent_order, a->memflags);
--
2.25.1
next prev parent reply other threads:[~2022-03-30 9:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-30 9:36 [PATCH 0/5] populate/unpopulate memory when domain on static Penny Zheng
2022-03-30 9:36 ` [PATCH v1 1/5] xen/arm: field "flags" to cover all internal CDF_XXX Penny Zheng
2022-04-01 18:02 ` Julien Grall
2022-03-30 9:36 ` [PATCH v1 2/5] xen/arm: introduce CDF_staticmem Penny Zheng
2022-04-01 18:06 ` Julien Grall
2022-03-30 9:36 ` [PATCH v1 3/5] xen/arm: unpopulate memory when domain on static allocation Penny Zheng
2022-03-30 9:52 ` Jan Beulich
2022-03-31 6:13 ` Penny Zheng
2022-03-31 7:05 ` Jan Beulich
2022-03-31 10:30 ` Penny Zheng
2022-04-01 18:53 ` Julien Grall
2022-04-02 10:16 ` Penny Zheng
2022-04-04 11:33 ` Jan Beulich
2022-04-01 18:10 ` Julien Grall
2022-03-30 9:36 ` Penny Zheng [this message]
2022-03-30 9:58 ` [PATCH v1 4/5] xen/arm: retrieve reserved pages on populate_physmap Jan Beulich
2022-03-31 6:53 ` Penny Zheng
2022-03-30 9:36 ` [PATCH v1 5/5] xen/arm: no need to store pages in resv_page_list when domain is directly mapped Penny Zheng
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=20220330093617.3870589-5-Penny.Zheng@arm.com \
--to=penny.zheng@arm.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=henry.wang@arm.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=sstabellini@kernel.org \
--cc=wei.chen@arm.com \
--cc=wl@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.