|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFC PATCH v6 07/43] arm/altp2m: Introduce CONFIG_ALTP2M Kconfig option
From: Rose Spangler <Rose.Spangler@xxxxxxxxxxxxxx>
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |