xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Penny Zheng <penny.zheng@arm.com>
To: <xen-devel@lists.xenproject.org>, <sstabellini@kernel.org>,
	<julien@xen.org>
Cc: <Bertrand.Marquis@arm.com>, <Penny.Zheng@arm.com>,
	<Wei.Chen@arm.com>, <nd@arm.com>
Subject: [PATCH V4 06/10] xen/arm: introduce PGC_reserved
Date: Wed, 28 Jul 2021 10:27:53 +0000	[thread overview]
Message-ID: <20210728102758.3269446-7-penny.zheng@arm.com> (raw)
In-Reply-To: <20210728102758.3269446-1-penny.zheng@arm.com>

This patch introduces a new page flag PGC_reserved in order to differentiate
pages of static memory from those allocated from heap.

Mark pages of static memory PGC_reserved when initializing them.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
---
 xen/common/page_alloc.c  | 3 +++
 xen/include/asm-arm/mm.h | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2acb73e323..f51e406401 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1536,6 +1536,9 @@ void __init free_staticmem_pages(struct page_info *pg, unsigned long nr_mfns,
             /* TODO: asynchronous scrubbing for pages of static memory. */
             scrub_one_page(pg);
         }
+
+        /* In case initializing page of static memory, mark it PGC_reserved. */
+        pg[i].count_info |= PGC_reserved;
     }
 }
 #endif
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index ded74d29da..7b5e7b7f69 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -108,6 +108,9 @@ struct page_info
   /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+  /* Page is reserved */
+#define _PGC_reserved     PG_shift(3)
+#define PGC_reserved      PG_mask(1, 3)
 /* ... */
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
-- 
2.25.1



  parent reply	other threads:[~2021-07-28 10:29 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 10:27 [PATCH V4 00/10] Domain on Static Allocation Penny Zheng
2021-07-28 10:27 ` [PATCH V4 01/10] xen/arm: introduce domain " Penny Zheng
2021-08-11 13:32   ` Julien Grall
2021-08-16  5:21     ` Penny Zheng
2021-08-16 17:27       ` Julien Grall
2021-08-17  2:28         ` Penny Zheng
2021-07-28 10:27 ` [PATCH V4 02/10] xen/arm: introduce new helper device_tree_get_meminfo Penny Zheng
2021-08-11 13:35   ` Julien Grall
2021-08-16  5:27     ` Penny Zheng
2021-07-28 10:27 ` [PATCH V4 03/10] xen/arm: handle static memory in dt_unreserved_regions Penny Zheng
2021-08-11 13:48   ` Julien Grall
2021-08-16  6:00     ` Penny Zheng
2021-08-16 17:33       ` Julien Grall
2021-07-28 10:27 ` [PATCH V4 04/10] xen: introduce mark_page_free Penny Zheng
2021-08-11 14:08   ` Julien Grall
2021-07-28 10:27 ` [PATCH V4 05/10] xen/arm: static memory initialization Penny Zheng
2021-08-04 15:54   ` Jan Beulich
2021-08-13 12:20   ` Julien Grall
2021-08-16  6:12     ` Penny Zheng
2021-08-13 12:38   ` Julien Grall
2021-08-16  7:00     ` Wei Chen
2021-07-28 10:27 ` Penny Zheng [this message]
2021-08-13 12:21   ` [PATCH V4 06/10] xen/arm: introduce PGC_reserved Julien Grall
2021-08-16  6:13     ` Penny Zheng
2021-07-28 10:27 ` [PATCH V4 07/10] xen: re-define assign_pages and introduce assign_page Penny Zheng
2021-08-05  6:34   ` Jan Beulich
2021-08-13 12:27   ` Julien Grall
2021-08-13 12:32     ` Jan Beulich
2021-08-17  8:21     ` Penny Zheng
2021-07-28 10:27 ` [PATCH V4 08/10] xen/arm: introduce acquire_staticmem_pages and acquire_domstatic_pages Penny Zheng
2021-08-05  6:52   ` Jan Beulich
2021-08-13 13:00   ` Julien Grall
2021-08-16  6:43     ` Penny Zheng
2021-08-16 17:43       ` Julien Grall
2021-08-17  2:33         ` Penny Zheng
2021-07-28 10:27 ` [PATCH V4 09/10] xen/arm: check "xen,static-mem" property during domain construction Penny Zheng
2021-08-13 13:12   ` Julien Grall
2021-08-16  6:53     ` Penny Zheng
2021-07-28 10:27 ` [PATCH V4 10/10] xen/arm: introduce allocate_static_memory Penny Zheng
2021-08-13 13:36   ` Julien Grall
2021-08-16  7:51     ` Penny Zheng
2021-08-16 17:55       ` Julien Grall
2021-08-17  2:36         ` Penny Zheng
2021-07-28 10:27 ` [PATCH V4 04/10] xen: introduce mark_page_free 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=20210728102758.3269446-7-penny.zheng@arm.com \
    --to=penny.zheng@arm.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Wei.Chen@arm.com \
    --cc=julien@xen.org \
    --cc=nd@arm.com \
    --cc=sstabellini@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).