Skip to contentSkip to conversation

altp2m: Move altp2m_vcpu_{initialise,destroy} to common code

RFC PATCH New [email protected] 1 participant 1 message Apr 20

lore
Share & tools
lore
#0 lore raw

RFC PATCH v6 28/43 altp2m: Move altp2m_vcpu_{initialise,destroy} to common code

From: Rose Spangler <[email protected]>

This commit moves the altp2m_vcpu_initialise and altp2m_vcpu_destroy functions to common code. This makes it possible to use them in the common implementation of HVMOP_altp2m_set_domain_state.

This commit contains only code movement, and no change in functionality is intended.

This is commit 1/2 of the altp2m_vcpu_{initialise,destroy} phase.

---
v6: Introduced this patch.

---
 xen/arch/x86/include/asm/altp2m.h |  6 -----
 xen/arch/x86/mm/altp2m.c          | 41 -------------------------------
 xen/common/altp2m.c               | 41 +++++++++++++++++++++++++++++++
 xen/include/xen/altp2m.h          |  6 +++++
 4 files changed, 47 insertions(+), 47 deletions(-)
xen/arch/x86/include/asm/altp2m.h +0 -6
index b3d348386a00..43dd5d2acd9c 100644
@@ -105,10 +105,6 @@ int altp2m_get_effective_entry(struct p2m_domain *ap2m, gfn_t gfn, mfn_t *mfn,
                                p2m_type_t *t, p2m_access_t *a,
                                bool prepopulate);
 
-/* Alternate p2m VCPU */
-void altp2m_vcpu_initialise(struct vcpu *v);
-void altp2m_vcpu_destroy(struct vcpu *v);
-
 int altp2m_vcpu_enable_ve(struct vcpu *v, gfn_t gfn);
 void altp2m_vcpu_disable_ve(struct vcpu *v);
 
@@ -151,8 +147,6 @@ static inline int _altp2m_get_effective_entry(struct p2m_domain *ap2m,
 
 /* Only declaration is needed. DCE will optimise it out when linking. */
 uint16_t altp2m_vcpu_idx(const struct vcpu *v);
-void altp2m_vcpu_initialise(struct vcpu *v);
-void altp2m_vcpu_destroy(struct vcpu *v);
 int altp2m_vcpu_enable_ve(struct vcpu *v, gfn_t gfn);
 void altp2m_vcpu_disable_ve(struct vcpu *v);
 
xen/arch/x86/mm/altp2m.c +0 -41

47 lines not on this page · raw message

xen/common/altp2m.c +41 -0

47 lines not on this page · raw message

xen/include/xen/altp2m.h +6 -0
index f5a4d0e60562..7defe6126563 100644
@@ -24,6 +24,12 @@ int altp2m_init(struct domain *d);
 /* Free altp2m views */
 void altp2m_teardown(struct domain *d);
 
+#ifdef CONFIG_X86
+/* Alternate p2m VCPU */
+void altp2m_vcpu_initialise(struct vcpu *v);
+void altp2m_vcpu_destroy(struct vcpu *v);
+#endif
+
 #ifdef CONFIG_ALTP2M
 
 /* Alternate p2m HVM on/off per domain */
Signature · 1 line
2.34.1