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

[PATCH v1 5/5] xen/arm: no need to store pages in resv_page_list when domain is directly mapped


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Wed, 30 Mar 2022 17:36:17 +0800
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=znsC665yGCk5zE8FKB/DjZh+uBcFbBobBpnEb5l3DdA=; b=bLMQP6Y+rsLDmjFa8qpakbCORiztYJJ+qLDH3qav4xhWCoJ2SZn/gs0OkMAba5BvYBkALO0N53DzJeC6oLOMPm44frFDTpC0jatvgEBbCnM354OQx4RHdcdVNHKj4CINqcLRqEsuf5xjjCezCZ310E1ZkcrraBEKdWp1b4wwpG53QcTukuHi7Fvlk1CMwqIoXouDx2sPSSrbvu+ceuf0kAa0dDAZyuHSvzynXcu0mqAxZpgNiFMU+DtRLbG0Yj48RS0ndYn9yO1njzjC4Q6BjMHP36fNm5PaPsh87+8fgCLaHlO2rfpr+VYhTShPfCqA24WYGh8dv37NcsRXy3KhQA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ovnq9ej+sqptTfndfJ7i4RGgH+A+x+lub4O9pYc+98GrlUwuSWGCcA2aTfYy5uGP+FTAUW5uNaDE15rpQpBtHqgjKjNgqctQ4bogf+pSKH30Rghnh5k/b4tft0//ibsof5f1EjvRmzgln4alXXg/Tdh+wNGgLLGnfjikGMn4ApVoG5zHnKZI0UX6o5ebVGocXiTe/R2cTVRh6MGoPF/KlrKcQ8H40tnRdwwBPzSXgru0rrFNgz3i0nHrmcWxUNME8yVDIOKQGocF+1o4SQd/G9rJgd1n7Ez9V+HY1Wg9EaISkpuvXCSnFmWJQHibbUw5XrrpcFBZ1X3qismNkptFag==
  • Cc: <wei.chen@xxxxxxx>, <henry.wang@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "George Dunlap" <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Penny Zheng <penny.zheng@xxxxxxx>
  • Delivery-date: Wed, 30 Mar 2022 09:38:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

When domain on static allocation and is directly mapped, in terms of
GPA == HPA(guest physical address == host physical address), we could use
mfn_to_page() to easily find the page, so there is no need to store pages
in resv_page_list.

Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
---
 xen/common/memory.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 2122ceeba7..2865e09a33 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -445,8 +445,11 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
      * When domain on static allocation, we shall store pages to 
resv_page_list,
      * so the hypercall populate_physmap could retrieve pages from it,
      * rather than allocating from heap.
+     * No need to store pages in resv_page_list when domain on static
+     * allocation and directly mapped, since we could use mfn_to_page() to
+     * easily find the page.
      */
-    if ( is_domain_on_static_allocation(d) )
+    if ( is_domain_on_static_allocation(d) && !is_domain_direct_mapped(d) )
     {
         page_list_add_tail(page, &d->resv_page_list);
         d->resv_pages++;
-- 
2.25.1




 


Rackspace

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