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

[PATCH 09/37] xen/x86: introduce two helpers to access memory hotplug end


  • To: <wei.chen@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Thu, 23 Sep 2021 20:02:08 +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; bh=7+me4FoPz33FS1cQ5pOAkpgqjLy+g/9qUY65MaXt3uY=; b=V4D92yE0UjSfZNXmoA/tnwYWl3sAAdUCOCjxx3RhEJ8ZL5NbfEYfZGe38eKtTO3D56Zvg79Kk/w1QYSc8uU9RB1YeI3oEo2buoCSsZ1Zmtr+hWE8356Mgq8kjKb5BFnYCcs3aNE+lR8uH/ET6vs2vPN2w4/lPvsALEFN5ntkm6qdbgbwEy/3ILCVEK5tCZW3aa4cYQR2tcJSwTK+2akoV489CIR2Nz96t1HxmMaKwnapY1qBWfxjKq77OGw0fe3rbrcVvQ7Wp07shqv9NI9v02jx+/+VSP4tOgUMqK46akUx/g3r6NwZI88q4Wix/64f2USZQSF7va0crXpwvRoMcA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kVNJJfMRr8Ane83w7P6tHN1EJLgkv9HCKHJM5cRUHipLxd8Yj+CUcaz0WZYzKWKAM6cCbZD8jdia51kpvTVDHNBRdGKy+Hc79jp9f4L7LTRdhMrrnHI0RBsIPkljsBX/u0jz35SEVVpcO6e1Ql0lPWKVf3ANwf6S7npYy4s4HZ1aYv9QGGV7yksSryJFyCFW78lIfzcFWoVjXHCDSNqiJZJEj/wYQRcZnOV/390WJRJ5Mz7obLb1JGNyRK2FPxjXYbUlfGGv738s3MrQyIc2GnFr74j6O51eLHeq4Z/R20ltci+yQlkmDQTqW0+ARlvFQq6D5mEhUFvIYgLUzsy+gQ==
  • Cc: <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Thu, 23 Sep 2021 12:03:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

x86 provides a mem_hotplug to maintain the end of memory hotplug
end address. This variable can be accessed out of mm.c. We want
some code out of mm.c can be reused by other architectures without
memory hotplug ability. So in this patch, we introduce these two
helpers to replace mem_hotplug direct access. This will give the
ability to stub these two API.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
 xen/include/asm-x86/mm.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index cb90527499..af2fc4b0cd 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -475,6 +475,16 @@ static inline int get_page_and_type(struct page_info *page,
 
 extern paddr_t mem_hotplug;
 
+static inline void mem_hotplug_update_boundary(paddr_t end)
+{
+    mem_hotplug = end;
+}
+
+static inline paddr_t mem_hotplug_boundary(void)
+{
+    return mem_hotplug;
+}
+
 /******************************************************************************
  * With shadow pagetables, the different kinds of address start
  * to get get confusing.
-- 
2.25.1




 


Rackspace

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