diff mbox series

[XEN,v1,07/15] x86/p2m: guard vmx specific ept functions with CONFIG_VMX

Message ID 20240416063328.3469386-1-Sergiy_Kibrik@epam.com (mailing list archive)
State Superseded
Headers show
Series x86: make cpu virtualization support configurable | expand

Commit Message

Sergiy Kibrik April 16, 2024, 6:33 a.m. UTC
From: Xenia Ragiadakou <burzalodowa@gmail.com>

The functions ept_p2m_init() and ept_p2m_uninit() are VT-x specific.
Do build-time checks and skip these functions execution when !VMX.

No functional change intended.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
---
 xen/arch/x86/mm/p2m-basic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/xen/arch/x86/mm/p2m-basic.c b/xen/arch/x86/mm/p2m-basic.c
index 90106997d7..6810941c30 100644
--- a/xen/arch/x86/mm/p2m-basic.c
+++ b/xen/arch/x86/mm/p2m-basic.c
@@ -38,7 +38,7 @@  static int p2m_initialise(struct domain *d, struct p2m_domain *p2m)
     p2m_pod_init(p2m);
     p2m_nestedp2m_init(p2m);
 
-    if ( hap_enabled(d) && cpu_has_vmx )
+    if ( IS_ENABLED(CONFIG_VMX) && hap_enabled(d) && cpu_has_vmx )
         ret = ept_p2m_init(p2m);
     else
         p2m_pt_init(p2m);
@@ -70,7 +70,7 @@  struct p2m_domain *p2m_init_one(struct domain *d)
 void p2m_free_one(struct p2m_domain *p2m)
 {
     p2m_free_logdirty(p2m);
-    if ( hap_enabled(p2m->domain) && cpu_has_vmx )
+    if ( IS_ENABLED(CONFIG_VMX) && hap_enabled(p2m->domain) && cpu_has_vmx )
         ept_p2m_uninit(p2m);
     free_cpumask_var(p2m->dirty_cpumask);
     xfree(p2m);