[RFC PATCH v6 39/43] x86/altp2m: Add altp2m_reset_altp2m declaration to arch header

Rose Spangler posted 43 patches 3 months, 3 weeks ago
[RFC PATCH v6 39/43] x86/altp2m: Add altp2m_reset_altp2m declaration to arch header
Posted by Rose Spangler 3 months, 3 weeks ago
This commit makes altp2m_reset_altp2m non-static and adds a declaration to
the asm/altp2m.h header. This makes it possible to call this function in
common altp2m routines. The altp2m_reset_type enum (which is the type of
one of the parameters of altp2m_reset) is also moved to the asm/altp2m.h
header.

This is commit 1/2 of the altp2m_reset_altp2m phase.

Signed-off-by: Rose Spangler <Rose.Spangler@elektrobit.com>
---
v6: Introduced this patch.
---
 xen/arch/x86/include/asm/altp2m.h | 8 ++++++++
 xen/arch/x86/mm/altp2m.c          | 9 ++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/include/asm/altp2m.h b/xen/arch/x86/include/asm/altp2m.h
index e7239326c71d..02b5e1a11220 100644
--- a/xen/arch/x86/include/asm/altp2m.h
+++ b/xen/arch/x86/include/asm/altp2m.h
@@ -92,6 +92,14 @@ 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);
 
+/* Reset an altp2m view */
+enum altp2m_reset_type {
+    ALTP2M_RESET,
+    ALTP2M_DEACTIVATE
+};
+void altp2m_reset_altp2m(struct domain *d, unsigned int idx,
+                         enum altp2m_reset_type reset_type);
+
 /* Activate an altp2m view */
 int altp2m_activate_altp2m(struct domain *d, unsigned int idx,
                            p2m_access_t hvmmem_default_access);
diff --git a/xen/arch/x86/mm/altp2m.c b/xen/arch/x86/mm/altp2m.c
index edbaf54c3761..18f8a71f1682 100644
--- a/xen/arch/x86/mm/altp2m.c
+++ b/xen/arch/x86/mm/altp2m.c
@@ -228,13 +228,8 @@ bool altp2m_get_or_propagate(struct p2m_domain *ap2m, unsigned long gfn_l,
     return true;
 }
 
-enum altp2m_reset_type {
-    ALTP2M_RESET,
-    ALTP2M_DEACTIVATE
-};
-
-static void altp2m_reset_altp2m(struct domain *d, unsigned int idx,
-                                enum altp2m_reset_type reset_type)
+void altp2m_reset_altp2m(struct domain *d, unsigned int idx,
+                         enum altp2m_reset_type reset_type)
 {
     struct p2m_domain *p2m;
 
-- 
2.34.1