x86/p2m: guard EPT functions with using_vmx() check

Replace cpu_has_vmx check with using_vmx(), so that DCE would remove calls
to functions ept_p2m_init() and ept_p2m_uninit() on non-VMX build.
Since currently Intel EPT implementation depends on CONFIG_INTEL_VMX config
option, when VMX is off these functions are unavailable.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Xenia Ragiadakou authored and Jan Beulich committed 2024-08-01 13:56:09 +02:00
1 parent 3f7efa20e4
commit e961970ae2
1 file changed
+2 -2
+2 -2
View File
@@ -40,7 +40,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 ( hap_enabled(d) && using_vmx() )
ret = ept_p2m_init(p2m);
else
p2m_pt_init(p2m);
@@ -72,7 +72,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 ( hap_enabled(p2m->domain) && using_vmx() )
ept_p2m_uninit(p2m);
free_cpumask_var(p2m->dirty_cpumask);
xfree(p2m);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.