This commit adds a declaration for altp2m_activate_altp2m to the x86
asm/altp2m.h header. This makes it possible to call the function in common
altp2m routines (namely, altp2m_init_by_id).
This is commit 1/2 of the altp2m_activate_altp2m phase.
Signed-off-by: Rose Spangler <Rose.Spangler@elektrobit.com>
---
v6: Introduced this patch.
---
xen/arch/x86/include/asm/altp2m.h | 4 ++++
xen/arch/x86/mm/altp2m.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/include/asm/altp2m.h b/xen/arch/x86/include/asm/altp2m.h
index 99c4cfa5a68b..203dba44e2bf 100644
--- a/xen/arch/x86/include/asm/altp2m.h
+++ b/xen/arch/x86/include/asm/altp2m.h
@@ -95,6 +95,10 @@ int altp2m_init_next_available(struct domain *d, uint16_t *idx,
/* Make a specific alternate p2m invalid */
int altp2m_destroy_by_id(struct domain *d, unsigned int idx);
+/* Activate an altp2m view */
+int altp2m_activate_altp2m(struct domain *d, unsigned int idx,
+ p2m_access_t hvmmem_default_access);
+
/* Switch alternate p2m for entire domain */
int altp2m_switch_domain_altp2m_by_id(struct domain *d, unsigned int idx);
diff --git a/xen/arch/x86/mm/altp2m.c b/xen/arch/x86/mm/altp2m.c
index 8672b8c061d3..40c6ea72a621 100644
--- a/xen/arch/x86/mm/altp2m.c
+++ b/xen/arch/x86/mm/altp2m.c
@@ -274,8 +274,8 @@ void altp2m_flush(struct domain *d)
altp2m_unlock(d);
}
-static int altp2m_activate_altp2m(struct domain *d, unsigned int idx,
- p2m_access_t hvmmem_default_access)
+int altp2m_activate_altp2m(struct domain *d, unsigned int idx,
+ p2m_access_t hvmmem_default_access)
{
struct p2m_domain *hostp2m, *p2m;
int rc;
--
2.34.1