[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH V4 06/10] xen/arm: introduce PGC_reserved


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>
  • From: Penny Zheng <penny.zheng@xxxxxxx>
  • Date: Wed, 28 Jul 2021 10:27:53 +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=aq/CVp/Ccy89yXBl4+lKWxTcJAN2riHCxWA4scIZ/gk=; b=An0ALzUDtTqXGssePqPdmijk+t8AGpKGRuMaLwpnozE5Ekfc0PXfBhkKqvTbytJeco1wEXehnCjGq3I5DnHc0JLRBG9VU79VsHeWvyO0WiJqABcisr9KZkTe7BYmSN1xdvdk+3iAHcGROm+EBUehd8oSsLa/Ah56IOznp16awo8BWVEMCQFYEfikQB8w9XO16SkODYTVVlfTeNdzKfzseVKfpvC4MNv4G4HIyuG4R5wP680fiKIt7GViqx2AtDDg8Ys+CEF4Mo4PsCJKola4M7TnTRCsaCfJMoLChzuG7J2tTuSjyGuz1WHxxMv2uvo2W1Cr1J6Jv6XePP3nXjnrbg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UyawuLUc0VdWsIVBAc4Ffaqr0TTx+O64R7m0SGgXVlRmJ2YFDg/OfJrKVwOHAKWwnEZ0cnxkARmWqtYoQnxLqLcHpn13fzQxhvspME/eRdrXXaPshO7YrFfKkfj662/ti9FKIou81tW2BNGrrOVWZ4iMPHI0aL1Ijown/+bLK6gyY8nfTZ73UeLQZHrH539BdWj8a0ffvI2vrB6+eTZ+YgegDz4oxgrZVO0SWC+kJ3s/ulzKW/6Zep6KozgWS0/9TivgxHpIDGKl9EM74TKSkdoZ6d66+9/vXifc69/eAOpwDIhAuufu6kQn7Px1hVmb5ac6j5LrrN6ucMuJiN1SmA==
  • Cc: <Bertrand.Marquis@xxxxxxx>, <Penny.Zheng@xxxxxxx>, <Wei.Chen@xxxxxxx>, <nd@xxxxxxx>
  • Delivery-date: Wed, 28 Jul 2021 10:28:55 +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>
---
 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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.