The declaration of p2m_set_suppress_ve_multi() is in <asm/mem_access.h> and
hasn't been included on compiling altp2m.o when VM_EVENT=n, resulting in
undefined error.
To fix it, we could simply move p2m_set_suppress_ve_multi() forward.
Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
---
v2 -> v3:
- new commit
---
xen/arch/x86/mm/altp2m.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/xen/arch/x86/mm/altp2m.c b/xen/arch/x86/mm/altp2m.c
index 0261360aae..962111fbb0 100644
--- a/xen/arch/x86/mm/altp2m.c
+++ b/xen/arch/x86/mm/altp2m.c
@@ -640,23 +640,6 @@ int p2m_altp2m_propagate_change(struct domain *d, gfn_t gfn,
return ret;
}
-/*
- * Set/clear the #VE suppress bit for a page. Only available on VMX.
- */
-int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve,
- unsigned int altp2m_idx)
-{
- int rc;
- struct xen_hvm_altp2m_suppress_ve_multi sve = {
- altp2m_idx, suppress_ve, 0, 0, gfn_x(gfn), gfn_x(gfn), 0
- };
-
- if ( !(rc = p2m_set_suppress_ve_multi(d, &sve)) )
- rc = sve.first_error;
-
- return rc;
-}
-
/*
* Set/clear the #VE suppress bit for multiple pages. Only available on VMX.
*/
@@ -725,6 +708,23 @@ int p2m_set_suppress_ve_multi(struct domain *d,
return rc;
}
+/*
+ * Set/clear the #VE suppress bit for a page. Only available on VMX.
+ */
+int p2m_set_suppress_ve(struct domain *d, gfn_t gfn, bool suppress_ve,
+ unsigned int altp2m_idx)
+{
+ int rc;
+ struct xen_hvm_altp2m_suppress_ve_multi sve = {
+ altp2m_idx, suppress_ve, 0, 0, gfn_x(gfn), gfn_x(gfn), 0
+ };
+
+ if ( !(rc = p2m_set_suppress_ve_multi(d, &sve)) )
+ rc = sve.first_error;
+
+ return rc;
+}
+
int p2m_get_suppress_ve(struct domain *d, gfn_t gfn, bool *suppress_ve,
unsigned int altp2m_idx)
{
--
2.34.1