Replace cpu_has_vmx check with using_vmx(), so that not only VMX support in CPU
is being checked at runtime, but also at build time we ensure the availability
of functions vmx_vmcs_enter() & vmx_vmcs_exit().
Also since CONFIG_VMX is checked in using_vmx and it depends on CONFIG_HVM,
we can drop #ifdef CONFIG_HVM lines around using_vmx.
Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
vcpu_pause(v); /* acceptably dangerous */
-#ifdef CONFIG_HVM
/*
* For VMX special care is needed: Reading some of the register state will
* require VMCS accesses. Engaging foreign VMCSes involves acquiring of a
* region. Despite this being a layering violation, engage the VMCS right
* here. This then also avoids doing so several times in close succession.
*/
- if ( cpu_has_vmx && is_hvm_vcpu(v) )
+ if ( using_vmx() && is_hvm_vcpu(v) )
{
ASSERT(!in_irq());
vmx_vmcs_enter(v);
}
-#endif
/* Prevent interleaving of output. */
flags = console_lock_recursive_irqsave();
console_unlock_recursive_irqrestore(flags);
}
-#ifdef CONFIG_HVM
- if ( cpu_has_vmx && is_hvm_vcpu(v) )
+ if ( using_vmx() && is_hvm_vcpu(v) )
vmx_vmcs_exit(v);
-#endif
vcpu_unpause(v);
}