[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:18:31 -0400
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 40.93.1.74) 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=Hs7zSBKIelIqSF6Fx2qCws6Rt4H345CXSgBJx/f7dMi1SSh6hi/Uwx0hzPiQ7klNFXdb9s9IAGuDzwiHXV1qp3FGHjc+PgKbkRy7ptBaHKVric6siwpY+1TgMfFdIDdSy6YWTFDPx99tm7RTq8eKlknBna0bw4D1Is9NVx3Zl7/r5KdmNhcaOJvjjQL2X/7cAXiUbuv+uMTyVN4TAHjpASxfqYDaXZIylEeBQd36KFUSxlVlZ81D5eLE6SzvtqWyT0MKY/SgOwP7KAqQiQLssaW9TT3mkebQIhnaXaxQvhXej3cy7rrC62ldtqitosRbzNs5r25h7/bt7epZeqEocQ==
- 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=PWKowOrVAfNZpL3sRAKqw0Ds1lmFIOt7dtzPTdW9Pk+K10KfduTQaOyBBnJupzxPYcpbML+N4xFfkgFeyGAiZ2EjDJsjn5vm+1koRqEPEsU1yu32w4l8YKsJoT989Dn/Ao1T/RiFAIPMJVtOzB3cyqtTU9eCAh2lJ0nFWEeI/nIcNnjN9YxISkJsbOIh+0oFgEUock3AygKWYQYdPxUygbLgenUMa/F//bDBeg/2O1Az2/B7TlFNmWdEjDbp0sBDXh6OM8cDehxaMRGD4asN0eIQ2SShH6rYvpjf/wob+hs8FLM8CbW5HgQ7syqfkwNK14r7bS5qdHrfG39QK2jZQQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=SUXzjf+P8DXlRO8qHxgMyOiAzXbF6GzMAnMvC/upzYUeO1iaj68loWvFfON65FTvrVsdT/RVMIiTgfiLT0yWfqtPSn5PcALw716oR3UkrFqyUxVbpK5YjB/ot9GHO5XGKGIJ6zW0IE+QjPy0KsmupIq4xjqzH6Z5quUKffFnCoSRqrUP7yF+q+I+eNNS1CKlRMkxQATJZYSW8Q1VPefXHIccB6WlUbjpaMV3FbzVAGdho64dUrroTPiXLaUZ4IxhMvRHuP1npwt6XJYh7O3tE70+IGZDLg5ySGgLlzVhZn8SHGK5PXi4f7lM5zTb6uQn7RTQQXqXhtk2JUJauwSM1w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lteC48OrWg27m/c40n1ydVpKtDpXX5JhGjbOisVzz4bmwGpw8ffxyz3uqL8C369rwaeTOEf4uRoSla+gwNT02Z5n25/e9yAH8KjsOV7sOxE+gzpe+Hgi8jz5j7slpYKbVCz4/rl5U7RQ4m1dF8dymaWjx11WLTMX/IsZuQ9ecXWhz3HelmpI6G6lALkWgdwGTb6jo21HieuOfhGjGzmsAGgTCgluZ1vo6FECS7NlU8Nfh76U1ncx8ntNXmcT6jLq/9sNfhD/QoKd5S+HuOPbXwdLFoFL3hYvhNfLaOtqDyASxC6x0/cFC2781JZZfFL2ryVczDMDcbShJoBtQN8JMg==
- 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:19:07 +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
|