[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V3 06/10] xen/arm: introduce PGC_reserved
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>
- From: Penny Zheng <penny.zheng@xxxxxxx>
- Date: Thu, 15 Jul 2021 05:18:15 +0000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FSUaZhIJ132fP5dvjR7UOX33VSmQ3hubM795HYhZnO8=; b=gCZMUUcuOkKxsNd676rEkkjppeD7WpDRNLT//woOK2VHeK+takVp89Ji1GUQU9j0S1OdDJgDSlw9xD7SE8N7M3WUMRrLKuSGFOh2jiatimt5UU6t3XpmQJzTKhcFgEHoixNLr93z+I0dRSLtPjbBOnjRlhl7DXp+Bmt8g1zCg9dvDt5CLLT4EviJ6dUWwrWlbxcRIAfl9YREq89BOyPW4JUcWGZ2PBnXTM0KNObJ2SKmv7+LruTDepeuqtT5vsHB6dSkqVBsPGMk7KJQYmy2xtrimNH9To6B86Tq5uqFaH/ghO2D239DHCuDANeZ3+bt+CmO5mXR5cPD0LDGN/bg9w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BFIAIjILSdi41Vv7YqWgpIM4cIm4Pmsl5oLtdjihxh523UeDEPHmgZxNQxhL0I4u+bHmYBfSRF9AFDHurgn0TTlZn1uXnbDFvtVxyy+ItiDKngjqU1dqmbwPUnZZRAQv8e3oM4l7bNWmv5EnnkGVfZM9NEeqjjcIro2HWXcyzUxp/Mzijs3ZfWMeLIT16VAe+TIlu4m6LRuuHFK41EWg6xxGbd+yAW43+UWihXUUA2cAPjgpOEuyDAQs8eo2zCCnZasRHIjh/tW8Y9DmLlNwd4J1Iut5CKgvhk4myFIEMe8KfKRJKcVHoAlaW/f3x+ZTb13uCwV5HY2Ot6QoJn4qrQ==
- Cc: <Bertrand.Marquis@xxxxxxx>, <Penny.Zheng@xxxxxxx>, <Wei.Chen@xxxxxxx>, <jbeulich@xxxxxxxx>, <nd@xxxxxxx>
- Delivery-date: Thu, 15 Jul 2021 05:19:17 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
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@xxxxxxx>
---
v3 change:
- introduce PGC_reserved when it is firstly used.
---
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 f394d6627a..15edaca227 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
|