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

[RFC PATCH v6 07/43] arm/altp2m: Introduce CONFIG_ALTP2M Kconfig option


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>
  • Date: Mon, 20 Apr 2026 17:31:30 -0400
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 40.93.4.8) smtp.rcpttodomain=amd.com smtp.mailfrom=elektrobit.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=elektrobit.com; dkim=pass (signature was verified) header.d=elektrobit.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=elektrobit.com] dmarc=[1,1,header.from=elektrobit.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 213.95.148.172) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=elektrobit.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=elektrobit.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=mUHlmqTGoOfpLiPTAGkw3ZzBrGFd58Ji7foro+DAZoU=; b=cvILFjd/VdBmQWUjxb1CbatR1BWJWsiEKOL37XOQrqipV7/nJYPR7uplZWyboxDBGZy/N2YFTZA02H6HLd6R29ph6JHtf5KyX8pxxv/39zyAJDEJy1EL2hWjZI4oI4wg75Ux2f1nuVRlyjPs2gVV1HWOiyvraOHfLM3wyYYI44nxH+CCYrpuwliikxetNgmiQzM+fhEz982b/9m7esY0i9e1SGfVTIb7jnIgeh7N5mXUuC5QpazR8OvCuk6OtWy/5FhlvkG69kRHmtP3HPG047tgfpEWxBIGK3J4tgMo0I4LWKiiFm3BRDYzkkRgVPwo518EMyqAU/1iDZG5r/P8qQ==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=mUHlmqTGoOfpLiPTAGkw3ZzBrGFd58Ji7foro+DAZoU=; b=p8mY0arhJZr9DcMGrS3fxDPi+bi3IsikPH9ixQcXlDpUhrNI4HsCoE4ccS/5ko7+oRLoWTzjn41EzJv9F8LUiBx9p4Gqk9KHZCnwP5sgJSz6ArkikSMCbYvv4W601rdr07hJMIQmoLBPAd7IVxMm4/krFBWQOqA4eUbT6kJL2j6EqDn2uccOwXyHwT9PN5XE/UjTu8WjU0PZKo7bqtbiVfj979x+hVXdeMFVcsWQtGkP7Q1Le0hRUiTlkSy4jonmITlhgR1wYv4xu1I6r2MHN/UhuN92NGMs2AIGbCqpSh9e20rF2am71E+QdBYO66AdkO8Brwwpw/jYguE34OJOAQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=Vz8dN5cmCD803/A1a4IB/le34IIjZf4xOdmvK2lxSolKDJUJXfnIUujRp5ZCCZDKXAPm+R2F/bFgVhaJGzS6Tm5WEpOzgWLvrYhqqVp0oGB/GoT6SUUw9KosHCgGSFjlz9CXlm+AR7gupYNEPe6RUrDdTrrZ6cJOjrVoxWaLt/ZoZ9x3XQjWGj9gPn/pAWoO6V54Z94qgGL3tqdOiGN56vdd7y01h0k3AR5KhljrzqTW7ydq/f7kc8e/c4pVp/yrcFV0ShBhCqLR8XaA3KzJIbvnPbga3DczlsiGWCA05iaj8ePV2RMhpiLBYBQ/OT/VjAp41ZZZqB6K34pIAGmXzA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=y+maNGCt62v0NqFOWkafvLojA64pCTyVwWZn4K0Y/a44TFNEOVDTe3lAZkm0oSxJWA4XLD2wEvY77WCseab4j4ZCJNam8APzew9mpY2Jm1wL4l5/Ky41mzPdyDBvbLcpzsCJMH/EFjoJiQh3QXkjirWrnt/Hsvg2KD6t1Qu1kZgkhMCe7TTDfG8l2LnaIGw/ug/92VWmnkFCf7rUmC0NLjHza3dMzks1IB/QTKAIa59+XEUWXOHBijNQlRBjCXkIzXwsjJ7vOTE/gQU+N0P0q4Yckf705WJlfdVlcqKjc7vMsB9H/VCj+4H+DFIK9pxho+OGXLm2Qs2lquAHU1+/yg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=elektrobit.com header.i="@elektrobit.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=elektrobit.com header.i="@elektrobit.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Aqib Javaid <Aqib.Javaid@xxxxxxxxxxxxxx>
  • Delivery-date: Mon, 20 Apr 2026 21:32:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Following the x86 implementation in commit e96831ece819, this commit adds
the CONFIG_ALTP2M Kconfig option for ARM. This makes it possible to build
Xen without building altp2m code.

This commit also implements a stub for p2m_altp2m_check, as some
implementation is needed when CONFIG_ALTP2M is enabled. This is due to a
call to p2m_altp2m_check in vm_event.c which is gated by CONFIG_ALTP2M.

This is commit 7/8 of the preparation phase.

Signed-off-by: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>
Signed-off-by: Aqib Javaid <Aqib.Javaid@xxxxxxxxxxxxxx>
---
v6: Introduced this patch.
---
 xen/arch/arm/Kconfig              | 11 +++++++++++
 xen/arch/arm/altp2m.c             |  9 +++++++++
 xen/arch/arm/include/asm/altp2m.h | 18 ++++++++++++++++--
 3 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 2f2b501fdac4..fdf0721c3c03 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -98,6 +98,17 @@ config MPU
          systems supporting EL2. (UNSUPPORTED)
 endchoice
 
+config ALTP2M
+       bool "Alternate P2M support" if EXPERT
+       depends on MMU
+       default y
+       help
+         Alternate-p2m allows a guest to manage multiple p2m guest physical
+         "memory views" (as opposed to a single p2m).
+         Useful for memory introspection.
+
+         If unsure, stay with defaults.
+
 source "arch/Kconfig"
 
 config ACPI
diff --git a/xen/arch/arm/altp2m.c b/xen/arch/arm/altp2m.c
index 2bd1ff4df223..8bd174ea8f37 100644
--- a/xen/arch/arm/altp2m.c
+++ b/xen/arch/arm/altp2m.c
@@ -5,6 +5,15 @@
  * Copyright (c) 2016 Sergej Proskurin <proskurin@xxxxxxxxxxxxx>
  */
 
+#include <asm/p2m.h>
+
+/* Check to see if vcpu should be switched to a different p2m. */
+void p2m_altp2m_check(struct vcpu *v, uint16_t idx)
+{
+    /* Not yet implemented */
+    BUG();
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/include/asm/altp2m.h 
b/xen/arch/arm/include/asm/altp2m.h
index ca836bae7330..698c35427e75 100644
--- a/xen/arch/arm/include/asm/altp2m.h
+++ b/xen/arch/arm/include/asm/altp2m.h
@@ -11,10 +11,12 @@
 
 #include <xen/sched.h>
 
+#ifdef CONFIG_ALTP2M
+
+/* Hardware always supports altp2m on ARM */
 static inline bool altp2m_supported(void)
 {
-    /* Not implemented yet */
-    return false;
+    return true;
 }
 
 /* Alternate p2m VCPU */
@@ -25,6 +27,18 @@ static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v)
     return 0;
 }
 
+#else /* CONFIG_ALTP2M */
+
+static inline bool altp2m_supported(void)
+{
+    return false;
+}
+
+/* Only declaration is needed. DCE will optimise it out when linking. */
+uint16_t altp2m_vcpu_idx(const struct vcpu *v);
+
+#endif /* CONFIG_ALTP2M */
+
 #endif /* __ASM_ARM_ALTP2M_H */
 
 /*
-- 
2.34.1




 


Rackspace

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